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/102982] New: [12 Regression] Dead Code Elimination Regression at -O3 (trunk vs 11.2.0) Date: Thu, 28 Oct 2021 09:47:39 +0000 [thread overview] Message-ID: <bug-102982-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102982 Bug ID: 102982 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 test.c void foo(void); static short a, b, d; static int c[2][2][2] = {0}; int main() { c[0][0][0] = 0; if (c[1][1][1]) { d = a % b >= 1 ^ 2; foo(); } } 11.2.0 at -O3 can eliminate the call to foo but trunk at -O3 cannot: gcc-11 test.c -O3 -S -o /dev/stdout ... main: .LFB0: .cfi_startproc movl $0, c(%rip) movl c+28(%rip), %eax testl %eax, %eax je .L2 ud2 .p2align 4,,10 .p2align 3 .L2: xorl %eax, %eax ret .cfi_endproc gcc-trunk test.c -O3 -S -o /dev/stdout ... main: .LFB0: .cfi_startproc movl $0, c(%rip) movl c+28(%rip), %ecx testl %ecx, %ecx je .L4 pushq %rax .cfi_def_cfa_offset 16 call foo xorl %eax, %eax popq %rdx .cfi_def_cfa_offset 8 ret .L4: xorl %eax, %eax ret .cfi_endproc gcc-trunk -v Using built-in specs. Target: x86_64-pc-linux-gnu Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 12.0.0 20211028 (experimental) (GCC) Started with https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=b58dc0b803057c0e6032e0d9bd92cd834f72c75c
next reply other threads:[~2021-10-28 9:47 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-10-28 9:47 theodort at inf dot ethz.ch [this message] 2021-10-28 9:48 ` [Bug tree-optimization/102982] " theodort at inf dot ethz.ch 2021-10-28 9:55 ` pinskia at gcc dot gnu.org 2021-10-28 11:42 ` [Bug ipa/102982] " rguenth at gcc dot gnu.org 2021-10-28 12:14 ` hubicka at kam dot mff.cuni.cz 2021-10-28 12:27 ` rguenth at gcc dot gnu.org 2021-10-28 12:34 ` Jan Hubicka 2021-10-28 12:34 ` hubicka at kam dot mff.cuni.cz 2022-05-06 8:31 ` [Bug ipa/102982] [12/13 " jakub at gcc dot gnu.org 2022-07-26 13:10 ` rguenth at gcc dot gnu.org 2023-05-08 12:23 ` [Bug ipa/102982] [12/13/14 " rguenth 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-102982-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).