From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 525633858C98; Wed, 15 Nov 2023 09:43:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 525633858C98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1700041380; bh=EKtSi9bptC8Ohh9UQep5ODjid8roLAK6C5CG1U9hzdY=; h=From:To:Subject:Date:From; b=gvpV2ryVKsLgdE8WBNc/9S4dSJSHtlc1ogWz5sWrPKWHsxHycRouArBIRCNrtOiey ijUGLIurua70vEwoz7xJlFvmykfnmWhT1OuLxkaMW7rLxSLzAJxxYiIxR/kbFteXPR GXIveeql3VEVORr6k0b0wsHGxTk6rjqkufwe2mMQ= From: "theodort at inf dot ethz.ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/112542] New: [14 Regression] Dead Code Elimination Regression since r14-4280-gc3c6f30496d Date: Wed, 15 Nov 2023 09:42:59 +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=3D112542 Bug ID: 112542 Summary: [14 Regression] Dead Code Elimination Regression since r14-4280-gc3c6f30496d 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/3vj8x1bPK Given the following code: void foo(void); static short b =3D -1; static int c, e; static int *f =3D &c; static char g; static char(a)(char h, int i) { if (!(((i) >=3D -1) && ((i) <=3D 0))) { __builtin_unreachable(); } return h || i ? h : h < 0; } static void(d)(unsigned h) { if (!(((h) >=3D 0) && ((h) <=3D 4095017279))) { foo(); } } int main() { *f =3D b =3D=3D 0; g =3D a(c, c); d(g); d(4095017279); if (e) b =3D 0; a(0, b); } gcc-trunk -O3 does not eliminate the call to foo: main: xorl %eax, %eax cmpw $0, b(%rip) sete %al movl %eax, c(%rip) jne .L4 pushq %rax call foo xorl %eax, %eax popq %rdx ret .L4: xorl %eax, %eax ret gcc-13.2.0 -O3 eliminates the call to foo: main: xorl %eax, %eax cmpw $0, b(%rip) sete %al movl %eax, c(%rip) xorl %eax, %eax ret Bisects to r14-4280-gc3c6f30496d=