From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3252D3857C4D; Mon, 28 Mar 2022 17:06:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3252D3857C4D From: "yann at ywg dot ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/105086] New: Dead Code Elimination Regression at -Os (trunk vs. 11.2.0) 25 Date: Mon, 28 Mar 2022 17:06:03 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: yann at ywg dot ch X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2022 17:06:04 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105086 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=3D52702&action=3Dedit The case presented. cat case.c #25 void foo(); int main() { unsigned a =3D -23; for (; a >=3D 2; ++a) if (a =3D=3D 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=3Dgcc.git;a=3Dcommit;h=3D502ffb1f389011b28ee5181= 5242c7397790802d5 ----- Build information ----- ----- 0127fb1b78a36a7b228d4b3fe32eedfc8d273363 (trunk) Target: x86_64-pc-linux-gnu Configured with: ../configure --disable-multilib --disable-bootstrap --enable-languages=3Dc,c++ --prefix=3D/zdata/compiler_cache/gcc-0127fb1b78a36a7b228d4b3fe32eedfc8d2733= 63 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=3Dc,c++ --prefix=3D/zdata/compiler_cache/gcc-01a9836c07053b3286b2259d6b628c7583413f= 55 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 11.2.0 (GCC)=