From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A047C398B436; Fri, 9 Apr 2021 11:37:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A047C398B436 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/99862] [meta-issue] various missed optimizations for dead code elimination Date: Fri, 09 Apr 2021 11:37:46 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: unknown X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Apr 2021 11:37:46 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99862 --- Comment #5 from Richard Biener --- (In reply to Zhendong Su from comment #0) > [561] % gcctk -v > Using built-in specs. > COLLECT_GCC=3Dgcctk > COLLECT_LTO_WRAPPER=3D/local/suz-local/software/local/gcc-trunk/libexec/g= cc/ > x86_64-pc-linux-gnu/11.0.1/lto-wrapper > Target: x86_64-pc-linux-gnu > Configured with: ../gcc-trunk/configure --disable-bootstrap > --prefix=3D/local/suz-local/software/local/gcc-trunk --enable-languages= =3Dc,c++ > --disable-werror --enable-multilib --with-system-zlib > Thread model: posix > Supported LTO compression algorithms: zlib > gcc version 11.0.1 20210401 (experimental) [master revision > e4bb1bd60a9:c23a685bf70:95d217ab52d31dc06fda42fc136dea165909e88b] (GCC)=20 > [562] %=20 > [562] % gcctk -O1 -S -o O1.s small.c > [563] % gcctk -O3 -S -o O3.s small.c > [564] %=20 > [564] % wc O1.s O3.s > 23 45 420 O1.s > 39 74 669 O3.s > 62 119 1089 total > [565] %=20 > [565] % grep foo O1.s > [566] % grep foo O3.s > call foo > [567] %=20 > [567] % cat small.c > extern void foo(void); > static int a, b; > static int c() { > foo(); > while (1) > while (b) > foo(); > } > void d() { > if (a) > c(); > } > int main() { > d(); > return 0; > } I filed this as PR99991.=