public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/108355] New: Dead Code Elimination Regression at -O2 (trunk vs. 12.2.0)
@ 2023-01-10 12:46 yann at ywg dot ch
  2023-01-10 14:45 ` [Bug tree-optimization/108355] [13 Regression] Dead Code Elimination Regression at -O2 since r13-2772-g9baee6181b4e42 marxin at gcc dot gnu.org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: yann at ywg dot ch @ 2023-01-10 12:46 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108355
           Summary: Dead Code Elimination Regression at -O2 (trunk vs.
                    12.2.0)
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: yann at ywg dot ch
  Target Milestone: ---

Created attachment 54230
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54230&action=edit
presented code as file

cat case.c #551
int a;
int *b = &a;
int **c = &b;
int d;
void bar25_(void);
void foo(void);
int main() {
  int e[][1] = {0, 0, 0, 0, 0, 1};
  for (;;) {
    bar25_();
    if (e[5][a])
      break;
    e[a][0] = 0;
    foo();
  }
  *c = &d;
}
`gcc-cb93c5f8008b95743b741d6f1842f9be50c6985c (trunk) -O2` can not eliminate
`foo` but `gcc-releases/gcc-12.2.0 -O2` can.

`gcc-cb93c5f8008b95743b741d6f1842f9be50c6985c (trunk) -O2 -S -o /dev/stdout
case.c`
--------- OUTPUT ---------
main:
.LFB0:
        .cfi_startproc
        subq    $40, %rsp
        .cfi_def_cfa_offset 48
        movl    $1, 20(%rsp)
        jmp     .L3
        .p2align 4,,10
        .p2align 3
.L6:
        movl    $0, (%rsp,%rax,4)
        call    foo
.L3:
        call    bar25_
        movslq  a(%rip), %rax
        movl    20(%rsp,%rax,4), %edx
        testl   %edx, %edx
        je      .L6
        movq    c(%rip), %rax
        movq    $d, (%rax)
        xorl    %eax, %eax
        addq    $40, %rsp
        .cfi_def_cfa_offset 8
        ret
---------- END OUTPUT ---------


`gcc-releases/gcc-12.2.0 -O2 -S -o /dev/stdout case.c`
--------- OUTPUT ---------
main:
.LFB0:
        .cfi_startproc
        subq    $8, %rsp
        .cfi_def_cfa_offset 16
        call    bar25_
        movq    c(%rip), %rax
        movq    $d, (%rax)
        xorl    %eax, %eax
        addq    $8, %rsp
        .cfi_def_cfa_offset 8
        ret
---------- END OUTPUT ---------


Bisects to:
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=9baee6181b4e427e0b5ba417e51424c15858dce7

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

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

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-10 12:46 [Bug tree-optimization/108355] New: Dead Code Elimination Regression at -O2 (trunk vs. 12.2.0) yann at ywg dot ch
2023-01-10 14:45 ` [Bug tree-optimization/108355] [13 Regression] Dead Code Elimination Regression at -O2 since r13-2772-g9baee6181b4e42 marxin at gcc dot gnu.org
2023-01-10 16:20 ` rguenth at gcc dot gnu.org
2023-01-11 14:46 ` rguenth at gcc dot gnu.org
2023-02-14 21:45 ` cvs-commit at gcc dot gnu.org
2023-02-14 21:48 ` pinskia at gcc dot gnu.org
2023-04-08 14:38 ` law at gcc dot gnu.org
2023-04-26  6:57 ` [Bug tree-optimization/108355] [13/14 " rguenth at gcc dot gnu.org
2023-07-27  9:25 ` rguenth at gcc dot gnu.org
2024-02-12 13:37 ` cvs-commit at gcc dot gnu.org
2024-02-28 14:03 ` [Bug tree-optimization/108355] [13 " cvs-commit at gcc dot gnu.org
2024-02-28 14:04 ` [Bug tree-optimization/108355] [13/14 " rguenth at gcc dot gnu.org
2024-03-08  1:07 ` hp at gcc dot gnu.org
2024-03-08  1:13 ` pinskia at gcc dot gnu.org
2024-03-08  7:25 ` rguenth at gcc dot gnu.org
2024-03-08  7:28 ` cvs-commit at gcc dot gnu.org
2024-05-21  9:13 ` [Bug tree-optimization/108355] [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).