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/110450] New: [14 Regression] Dead Code Elimination Regression at -O2 since r14-261-g0ef3756adf0 Date: Wed, 28 Jun 2023 10:21:15 +0000 [thread overview] Message-ID: <bug-110450-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110450 Bug ID: 110450 Summary: [14 Regression] Dead Code Elimination Regression at -O2 since r14-261-g0ef3756adf0 Product: gcc Version: 14.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: --- https://godbolt.org/z/KqcYxfevj Given the following code: void foo(void); static int a = 1; static int *b = &a, *c = &a; static short d, e; static char f = 11; static char(g)(char h, int i) { return h << i; } int main() { if (f) *c = g(0 >= a, 3); e = *c; d = e % f; if (d) { __builtin_unreachable(); } else if (*b) foo(); ; } gcc-trunk -O2 does not eliminate the call to foo: main: movl a(%rip), %eax xorl %edx, %edx testl %eax, %eax setle %dl leal 0(,%rdx,8), %edx movl %edx, a(%rip) jle .L8 xorl %eax, %eax ret .L8: pushq %rax call foo xorl %eax, %eax popq %rdx ret gcc-13.1.0 -O2 eliminates the call to foo: main: movl a(%rip), %edx xorl %eax, %eax testl %edx, %edx setle %al leal 0(,%rax,8), %eax movl %eax, a(%rip) xorl %eax, %eax ret Bisects to r14-261-g0ef3756adf0
next reply other threads:[~2023-06-28 10:21 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-06-28 10:21 theodort at inf dot ethz.ch [this message] 2023-06-29 6:52 ` [Bug tree-optimization/110450] " rguenth at gcc dot gnu.org 2023-07-01 20:51 ` pinskia at gcc dot gnu.org 2023-11-24 4:01 ` pinskia at gcc dot gnu.org 2024-01-10 15:13 ` jamborm at gcc dot gnu.org 2024-01-11 0:56 ` pinskia at gcc dot gnu.org 2024-01-13 4:39 ` cvs-commit at gcc dot gnu.org 2024-01-13 4:40 ` pinskia 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-110450-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).