public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "theodort at inf dot ethz.ch" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/104526] New: [12 Regression] Dead Code Elimination Regression at -O3 (trunk vs. 11.2.0) Date: Mon, 14 Feb 2022 10:07:43 +0000 [thread overview] Message-ID: <bug-104526-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104526 Bug ID: 104526 Summary: [12 Regression] Dead Code Elimination Regression at -O3 (trunk vs. 11.2.0) Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: theodort at inf dot ethz.ch Target Milestone: --- cat case.c #138750 void foo(void); static int a, b = 1, *c = &b; int main() { for (; a; a--) { int d = 2 >> (1 / *c); if (!d) foo(); } } gcc-58aeb75d4097010ad9bb72b964265b18ab284f93 (trunk) -O3 can not eliminate foo but gcc-11.2.0 -O3 can. gcc-58aeb75d4097010ad9bb72b964265b18ab284f93 (trunk) -O3 -S -o /dev/stdout case.c --------- OUTPUT --------- main: .LFB0: .cfi_startproc movl a(%rip), %eax testl %eax, %eax je .L12 pushq %rbx .cfi_def_cfa_offset 16 .cfi_offset 3, -16 xorl %ebx, %ebx .L2: movl b(%rip), %ecx leal 1(%rcx), %eax cmpl $2, %eax movl $2, %eax cmova %ebx, %ecx sarl %cl, %eax testl %eax, %eax je .L3 movl $0, a(%rip) .L10: xorl %eax, %eax popq %rbx .cfi_remember_state .cfi_def_cfa_offset 8 ret .p2align 4,,10 .p2align 3 .L3: .cfi_restore_state call foo subl $1, a(%rip) jne .L2 jmp .L10 .L12: .cfi_def_cfa_offset 8 .cfi_restore 3 xorl %eax, %eax ret ---------- END OUTPUT --------- gcc-11.2.0 -O3 -S -o /dev/stdout case.c --------- OUTPUT --------- main: .LFB0: .cfi_startproc movl a(%rip), %eax testl %eax, %eax je .L2 movl $0, a(%rip) .L2: xorl %eax, %eax ret ---------- END OUTPUT --------- Bisects to: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=c2b610e7c6c89fd422c5c31f01023bcddf3cf4a5 ----- Build information ----- ----- 58aeb75d4097010ad9bb72b964265b18ab284f93 (trunk) Target: x86_64-pc-linux-gnu Configured with: ../configure --disable-multilib --disable-bootstrap --enable-languages=c,c++ Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 12.0.1 20220213 (experimental) (GCC) ----- releases/gcc-11.2.0 Target: x86_64-pc-linux-gnu Configured with: ../configure --disable-multilib --disable-bootstrap --enable-languages=c,c++ Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 11.2.0 (GCC)
next reply other threads:[~2022-02-14 10:07 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-02-14 10:07 theodort at inf dot ethz.ch [this message] 2022-02-14 10:12 ` [Bug tree-optimization/104526] " rguenth at gcc dot gnu.org 2022-02-14 13:41 ` jakub at gcc dot gnu.org 2022-02-14 14:33 ` jakub at gcc dot gnu.org 2022-02-14 22:14 ` amacleod at redhat dot com 2022-02-15 22:12 ` cvs-commit at gcc dot gnu.org 2022-02-15 22:13 ` amacleod at redhat dot com 2022-02-16 12:39 ` jakub at gcc dot gnu.org 2022-02-16 14:05 ` amacleod at redhat dot com 2022-02-16 14:07 ` jakub at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-104526-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).