From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 28F883858C27; Thu, 20 Jan 2022 11:13:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 28F883858C27 From: "aldyh at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/103721] [12 regression] wrong code generated for loop with conditional since r12-4790-g4b3a325f07acebf4 Date: Thu, 20 Jan 2022 11:13:10 +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: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: aldyh at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 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: Thu, 20 Jan 2022 11:13:11 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103721 --- Comment #11 from Aldy Hernandez --- The testcase for PR104067 shows an example where the dominance matters, irregardless of if we reset relations at the backedge point. There we have= a path that looks like 9->3->5->...: [local count: 1063004409]: # j_17 =3D PHI # q_18 =3D PHI # ivtmp_4 =3D PHI j_8 =3D j_17 + 1; if (j_8 =3D=3D 10) goto ; [34.00%] else goto ; [66.00%] [local count: 701582906]: _1 =3D (sizetype) j_8; _15 =3D _1 * 4; _14 =3D &a + _15; [local count: 1063004409]: # j_2 =3D PHI # prephitmp_16 =3D PHI <_14(4), &a(3)> if (prephitmp_16 =3D=3D q_18) goto ; [0.00%] else goto ; [100.00%] [local count: 1052374367]: goto ; [100.00%] Even if we reset relations and clear the root oracle at the backedge (9->3)= , we still get the _16 =3D=3D _18 in BB3, followed by the DEF of _16 in BB5.=