From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C6C233857813; Fri, 1 Oct 2021 06:30:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C6C233857813 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/102546] [12 Regregression] Missed Dead Code Elimination regression (trunk vs 11.2.0) at -O3 Date: Fri, 01 Oct 2021 06:30:37 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org 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: 12.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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: Fri, 01 Oct 2021 06:30:37 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102546 --- Comment #4 from Richard Biener --- (In reply to Aldy Hernandez from comment #2) > By VRP1 we seem to be calculating the following: >=20 > (f_8 << f_8) && (f_8 =3D=3D 0) >=20 > This would fold to false, which would elide the foo(): >=20 > [local count: 59055800]: > b =3D 0; > _3 =3D f_8 << f_8; > _4 =3D (char) _3; > _5 =3D (int) _4; > if (_4 > 0) > goto ; [64.06%] > else > goto ; [35.94%] >=20 > [local count: 34842922]: > if (f_8 =3D=3D 0) > goto ; [71.10%] > else > goto ; [28.90%] >=20 > [local count: 12809203]: > foo (); I think it's similar to in the other PR, with old EVRP when visiting BB 8 we pushed [1, +INF] as the global range for _4, then supposedly ranger manages to evaluate f_8 =3D=3D 0 with its backward infering somehow. We no longer do this "path sensitive" adjustment of (global) ranges since you removed the EVRP DOM walk algorithm.=