public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "scherrer.sv at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110991] New: [14 Regression] Dead Code Elimination Regression at -O2 since r14-1135-gc53f51005de Date: Fri, 11 Aug 2023 13:08:42 +0000 [thread overview] Message-ID: <bug-110991-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110991 Bug ID: 110991 Summary: [14 Regression] Dead Code Elimination Regression at -O2 since r14-1135-gc53f51005de Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: scherrer.sv at gmail dot com Target Milestone: --- static unsigned char a; static char b; void foo(void); int main() { a = 25; for (; a > 13; --a) b = a > 127 ?: a << 3; if (!b) foo(); } gcc-3a13884b23a (trunk) -O2 cannot eliminate the call to foo but gcc-releases/gcc-13.1.0 -O2 can. ----------------------------------------------------------------------- gcc-3a13884b23ae32b43d56d68a9c6bd4ce53d60017 -O2 case.c -S -o case.s --------- OUTPUT --------- main: .LFB0: .cfi_startproc movd .LC0(%rip), %xmm0 movd .LC1(%rip), %xmm1 xorl %eax, %eax .L2: addl $1, %eax movdqa %xmm0, %xmm2 paddb %xmm1, %xmm0 cmpl $3, %eax jne .L2 movdqa %xmm2, %xmm0 movb $13, a(%rip) paddb %xmm2, %xmm0 paddb %xmm0, %xmm0 movdqa %xmm0, %xmm1 paddb %xmm0, %xmm1 pxor %xmm0, %xmm0 pcmpgtb %xmm2, %xmm0 movd .LC2(%rip), %xmm2 pand %xmm0, %xmm2 pandn %xmm1, %xmm0 por %xmm2, %xmm0 movd %xmm0, %eax sarl $24, %eax movb %al, b(%rip) testb %al, %al je .L10 xorl %eax, %eax ret .L10: pushq %rax .cfi_def_cfa_offset 16 call foo xorl %eax, %eax popq %rdx .cfi_def_cfa_offset 8 ret ---------- END OUTPUT --------- ----------------------------------------------------------------------- gcc-2b98cc24d6af0432a74f6dad1c722ce21c1f7458 -O2 case.c -S -o case.s --------- OUTPUT --------- main: .LFB0: .cfi_startproc movb $112, b(%rip) xorl %eax, %eax movb $13, a(%rip) ret ---------- END OUTPUT --------- ----------------------------------------------------------------------- Bisects to r14-1135-gc53f51005de
next reply other threads:[~2023-08-11 13:08 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-08-11 13:08 scherrer.sv at gmail dot com [this message] 2023-08-11 15:59 ` [Bug tree-optimization/110991] " ubizjak at gmail dot com 2023-08-12 18:06 ` pinskia at gcc dot gnu.org 2023-08-14 7:28 ` rguenth at gcc dot gnu.org 2023-08-15 9:09 ` cvs-commit at gcc dot gnu.org 2023-08-15 9:09 ` 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-110991-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).