From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BFB973858416; Mon, 7 Aug 2023 10:33:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BFB973858416 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1691404437; bh=cZZuZC/eAdOt5CBJJMO4/nRWGU//xgh2zQSvU+6oVRg=; h=From:To:Subject:Date:From; b=q7RbbYWwPUg1rVhEdHPWRG7BlXdinj1sNoctLErVzz7QA9IcW+vd9PBnjkBNjVUEe NP+jR8XzNnLwFR73fVQvB175+JE+cGAUmJNoJ9J2S02XDADXsiyzstTHZ1HcGfDY6I dAVhXzjOpps+PlELMyCHxdpyWMqbOuStIXjfDz1M= From: "theodort at inf dot ethz.ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110931] New: [14 Regression] Dead Code Elimination Regression since r14-2890-gcc2003cd875 Date: Mon, 07 Aug 2023 10:33:57 +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: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: theodort at inf dot ethz.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 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110931 Bug ID: 110931 Summary: [14 Regression] Dead Code Elimination Regression since r14-2890-gcc2003cd875 Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: theodort at inf dot ethz.ch Target Milestone: --- https://godbolt.org/z/zPTeo8Mj9 Given the following code: void foo(void); static int a =3D 7, c; static int *d =3D &a, *e; static int **f =3D &e; static short g; static char(h)(char b) { if (!(((b) >=3D 1) && ((b) <=3D 1))) { __builtin_unreachable(); } return 0; } static void k(unsigned i) { short j =3D i; if (j) ; else { h(i); if ((e && i) <=3D 0) ; else foo(); *f =3D &c; } h(0 >=3D 0); } int main() { int l =3D *d; g =3D l; k(g); } gcc-trunk -O3 does not eliminate the call to foo: main: cmpw $0, a(%rip) jne .L5 cmpq $0, e(%rip) je .L6 pushq %rax call foo xorl %eax, %eax movq $c, e(%rip) popq %rdx ret .L6: movq $c, e(%rip) .L5: xorl %eax, %eax ret gcc-13.2.0 -O3 eliminates the call to foo: main: xorl %eax, %eax ret Bisects to r14-2890-gcc2003cd875=