public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/110992] New: [14 Regression] Dead Code Elimination Regression at -O3 since r14-1654-g7ceed7e3e29
@ 2023-08-11 13:24 scherrer.sv at gmail dot com
  2023-08-11 17:38 ` [Bug tree-optimization/110992] " pinskia at gcc dot gnu.org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: scherrer.sv at gmail dot com @ 2023-08-11 13:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110992

            Bug ID: 110992
           Summary: [14 Regression] Dead Code Elimination Regression at
                    -O3 since r14-1654-g7ceed7e3e29
           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 b;
static short c = 4;
void foo(void);
static short(a)(short d, short g) { return d * g; }
void e();
static char f() {
  b = 0;
  return 0;
}
int main() {
  int h = b;
  if ((short)(a(c && e, 65535) & h)) {
    foo();
    h || f();
  }
}

gcc-bcda361daae (trunk) -O3 cannot eliminate the call to foo but
gcc-releases/gcc-13.1.0 -O3 can.
-----------------------------------------------------------------------
gcc-bcda361daaec8623c91d0dff3ea8e576373b5f50 -O3 case.c -S -o case.s
--------- OUTPUT ---------
main:
.LFB2:
        .cfi_startproc
        cmpw    $0, b(%rip)
        jne     .L8
        xorl    %eax, %eax
        ret
.L8:
        pushq   %rax
        .cfi_def_cfa_offset 16
        call    foo
        xorl    %eax, %eax
        popq    %rdx
        .cfi_def_cfa_offset 8
        ret
---------- END OUTPUT ---------

-----------------------------------------------------------------------
gcc-2b98cc24d6af0432a74f6dad1c722ce21c1f7458 -O3 case.c -S -o case.s
--------- OUTPUT ---------
main:
.LFB2:
        .cfi_startproc
        xorl    %eax, %eax
        ret
---------- END OUTPUT ---------

-----------------------------------------------------------------------
Bisects to r14-1654-g7ceed7e3e29

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2024-05-21  9:16 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-11 13:24 [Bug tree-optimization/110992] New: [14 Regression] Dead Code Elimination Regression at -O3 since r14-1654-g7ceed7e3e29 scherrer.sv at gmail dot com
2023-08-11 17:38 ` [Bug tree-optimization/110992] " pinskia at gcc dot gnu.org
2023-08-26  0:30 ` pinskia at gcc dot gnu.org
2023-09-14 21:11 ` pinskia at gcc dot gnu.org
2023-09-14 21:22 ` pinskia at gcc dot gnu.org
2023-09-15  3:19 ` [Bug tree-optimization/110992] [13/14 Regression] missed VRP optimization due to transformation of `a & -zero_one_valued_p` into `a * zero_one_valued_p` pinskia at gcc dot gnu.org
2023-09-15  3:54 ` pinskia at gcc dot gnu.org
2023-09-15  4:13 ` pinskia at gcc dot gnu.org
2023-09-15  4:33 ` pinskia at gcc dot gnu.org
2023-09-15 16:28 ` pinskia at gcc dot gnu.org
2023-09-15 22:45 ` pinskia at gcc dot gnu.org
2023-09-16 16:33 ` pinskia at gcc dot gnu.org
2023-09-18 23:51 ` pinskia at gcc dot gnu.org
2024-03-07 23:24 ` law at gcc dot gnu.org
2024-03-09  6:40 ` law at gcc dot gnu.org
2024-03-09  8:55 ` xry111 at gcc dot gnu.org
2024-05-21  9:16 ` [Bug tree-optimization/110992] [13/14/15 " jakub at gcc dot gnu.org

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).