public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/110919] New: [14 Regression] Dead Code Elimination Regression at -O3 since r14-1691-gbc5a2c2e793
@ 2023-08-06 11:05 scherrer.sv at gmail dot com
  2023-08-06 11:35 ` [Bug tree-optimization/110919] " scherrer.sv at gmail dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: scherrer.sv at gmail dot com @ 2023-08-06 11:05 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110919
           Summary: [14 Regression] Dead Code Elimination Regression at
                    -O3 since r14-1691-gbc5a2c2e793
           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 short a, b;
static int e;
static int *j = &e;
void bar151_(void);
void foo(void);
void bar162_(void);
static int(d)(int k, int l) { return l == k && l - 1 ? k : 0; }
static void f();
static void g(unsigned short, unsigned);
static void h() {
  g(0, 4);
  f();
  int i = -1;
  g(0, i);
}
static void f(int k) { g(k, 0); }
static void g(unsigned short k, unsigned l) {
  if (k)
    bar151_();
  if (l)
    if (k)
      bar162_();
  short c = l;
  b = c == 0 || a;
  if (d(*j, b))
    foo();
}
int main() { h(); }

gcc-87b0749cfb9 (trunk) -O3 cannot eliminate the call to foo but
gcc-releases/gcc-13.1.0 -O3 can.
-----------------------------------------------------------------------
gcc-87b0749cfb9406790b108208b466cf507ae3c431 -O3 case.c -S -o case.s
--------- OUTPUT ---------
main:
.LFB4:
        .cfi_startproc
        subq    $8, %rsp
        .cfi_def_cfa_offset 16
        movl    $4, %esi
        xorl    %edi, %edi
        call    g
        xorl    %esi, %esi
        xorl    %edi, %edi
        call    g
        movl    $-1, %esi
        xorl    %edi, %edi
        call    g
        xorl    %eax, %eax
        addq    $8, %rsp
        .cfi_def_cfa_offset 8
        ret
---------- END OUTPUT ---------

-----------------------------------------------------------------------
gcc-2b98cc24d6af0432a74f6dad1c722ce21c1f7458 -O3 case.c -S -o case.s
--------- OUTPUT ---------
main:
.LFB4:
        .cfi_startproc
        subq    $8, %rsp
        .cfi_def_cfa_offset 16
        movl    $4, %esi
        xorl    %edi, %edi
        call    g
        xorl    %esi, %esi
        xorl    %edi, %edi
        call    g
        movl    $-1, %esi
        xorl    %edi, %edi
        call    g
        xorl    %eax, %eax
        addq    $8, %rsp
        .cfi_def_cfa_offset 8
        ret
---------- END OUTPUT ---------

-----------------------------------------------------------------------
Bisects to r14-1691-gbc5a2c2e793

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

end of thread, other threads:[~2024-05-07  7:41 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-06 11:05 [Bug tree-optimization/110919] New: [14 Regression] Dead Code Elimination Regression at -O3 since r14-1691-gbc5a2c2e793 scherrer.sv at gmail dot com
2023-08-06 11:35 ` [Bug tree-optimization/110919] " scherrer.sv at gmail dot com
2023-08-06 16:55 ` pinskia at gcc dot gnu.org
2023-08-06 17:12 ` pinskia at gcc dot gnu.org
2023-08-20  9:11 ` pinskia at gcc dot gnu.org
2023-08-20 18:36 ` pinskia at gcc dot gnu.org
2023-08-20 18:41 ` pinskia at gcc dot gnu.org
2023-09-04  5:53 ` pinskia at gcc dot gnu.org
2023-09-04  6:09 ` pinskia at gcc dot gnu.org
2023-09-04  6:55 ` pinskia at gcc dot gnu.org
2024-03-07 23:26 ` law at gcc dot gnu.org
2024-05-07  7:41 ` [Bug tree-optimization/110919] [14/15 " rguenth 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).