public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/105086] New: Dead Code Elimination Regression at -Os (trunk vs. 11.2.0) 25
@ 2022-03-28 17:06 yann at ywg dot ch
  2022-03-28 17:11 ` [Bug tree-optimization/105086] [12 Regression] " jakub at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: yann at ywg dot ch @ 2022-03-28 17:06 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105086
           Summary: Dead Code Elimination Regression at -Os (trunk vs.
                    11.2.0) 25
           Product: gcc
           Version: 12.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 52702
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52702&action=edit
The case presented.

cat case.c #25
void foo();
int main() {
  unsigned a = -23;
  for (; a >= 2; ++a)
    if (a == 55)
      foo();
}

`gcc-0127fb1b78a36a7b228d4b3fe32eedfc8d273363 (trunk) -Os` can not eliminate
`foo` but `gcc-releases/gcc-11.2.0 -Os` can.

`gcc-0127fb1b78a36a7b228d4b3fe32eedfc8d273363 (trunk) -Os -S -o /dev/stdout
case.c`
--------- OUTPUT ---------
main:
.LFB0:
        .cfi_startproc
        movl    $-23, %eax
.L6:
        cmpl    $55, %eax
        je      .L10
        incl    %eax
        jne     .L6
        xorl    %eax, %eax
        ret
.L10:
        pushq   %rax
        .cfi_def_cfa_offset 16
.L7:
        xorl    %eax, %eax
        call    foo
        movl    $56, %eax
.L2:
        incl    %eax
        je      .L12
        cmpl    $55, %eax
        jne     .L2
        jmp     .L7
.L12:
        xorl    %eax, %eax
        popq    %rdx
        .cfi_def_cfa_offset 8
        ret
---------- END OUTPUT ---------


`gcc-releases/gcc-11.2.0 -Os -S -o /dev/stdout case.c`
--------- OUTPUT ---------
main:
.LFB0:
        .cfi_startproc
        xorl    %eax, %eax
        ret
---------- END OUTPUT ---------


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

----- Build information -----
----- 0127fb1b78a36a7b228d4b3fe32eedfc8d273363 (trunk)
Target: x86_64-pc-linux-gnu
Configured with: ../configure --disable-multilib --disable-bootstrap
--enable-languages=c,c++
--prefix=/zdata/compiler_cache/gcc-0127fb1b78a36a7b228d4b3fe32eedfc8d273363
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.1 20220328 (experimental) (GCC)

----- releases/gcc-11.2.0
Target: x86_64-pc-linux-gnu
Configured with: ../configure --disable-multilib --disable-bootstrap
--enable-languages=c,c++
--prefix=/zdata/compiler_cache/gcc-01a9836c07053b3286b2259d6b628c7583413f55
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.0 (GCC)

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

end of thread, other threads:[~2023-05-08 12:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-28 17:06 [Bug tree-optimization/105086] New: Dead Code Elimination Regression at -Os (trunk vs. 11.2.0) 25 yann at ywg dot ch
2022-03-28 17:11 ` [Bug tree-optimization/105086] [12 Regression] " jakub at gcc dot gnu.org
2022-03-28 20:07 ` amacleod at redhat dot com
2022-03-29  7:31 ` rguenth at gcc dot gnu.org
2022-03-29 13:24 ` amacleod at redhat dot com
2022-03-29 13:37 ` jakub at gcc dot gnu.org
2022-03-29 13:41 ` amacleod at redhat dot com
2022-04-19 15:37 ` rguenth at gcc dot gnu.org
2022-05-06  8:33 ` [Bug tree-optimization/105086] [12/13 " jakub at gcc dot gnu.org
2023-05-08 12:24 ` [Bug tree-optimization/105086] [12/13/14 " 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).