From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0C3583857C77; Thu, 21 Oct 2021 14:42:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0C3583857C77 From: "amacleod at redhat dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/102879] [12 Regression] Dead Code Elimination Regression at -O3 Date: Thu, 21 Oct 2021 14:42:04 +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: amacleod at redhat dot com X-Bugzilla-Status: NEW 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: 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: Thu, 21 Oct 2021 14:42:05 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102879 --- Comment #2 from Andrew Macleod --- (In reply to Aldy Hernandez from comment #1) > >=20 > So, presumably _62 =3D=3D 0 cannot be true. If _62 =3D=3D 0, then >=20 > 0 =3D _30 >> _6; >=20 > But that cannot happen because _30 is 2 if you follow the series of copies > from the "c" global. >=20 > There is no way 0 =3D 2 >> x can ever be true. >=20 > There's probably a couple things missing here. Maybe > operator_rshift::op1_range needs to be taught that ~[0,0] =3D x >> y impl= ies x > is non-zero. But also, we can't see through the load from the c=3D2 glob= al.=20 > Shouldn't that c=3D2 have been propagated by someone at this point? (VRP= 1?) well, that depends on _6. 0 =3D _30 >> 32 is always true.=20 now, we do happen to know that _6 is [0,1], so if we did manage to determine that _30 is [2,2], then the we will fold [2,2] >> [0,1] into [1,2] and then everything should fall into place as we know we can never take that breanch. That means our core issue is c.2_28 =3D c; _29 =3D (char) c.2_28; _30 =3D (int) _29; if (_29 >=3D 0) that we don't propagate the 2 into the c.2_28. we are limited to a range = of [1,127] because of that.=