From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8BBEB3857810; Fri, 22 Oct 2021 08:32:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8BBEB3857810 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug bootstrap/102681] [12 Regression] AArch64 bootstrap failure Date: Fri, 22 Oct 2021 08:32:26 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: bootstrap X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: build, diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth 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: Fri, 22 Oct 2021 08:32:26 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102681 --- Comment #21 from Richard Biener --- (In reply to Andrew Pinski from comment #14) > Created attachment 51650 [details] > Little more reduced >=20 > So FRE is able to figure out for the following: > # _20 =3D PHI <0(2), 1(3)> > # const_upper_26 =3D PHI > .... > # _30 =3D PHI <0(12), 1(13)> > # const_upper_33 =3D PHI >=20 > That _30 is the same as _20 but not _26 is the same as _33 even though it > does figure out that _19 and _29 are the same as _10. If it is able to > figure that out, then things would just work. >=20 > Richi, > I assume FRE does not Value number default SSA names (non-parm) the same > which is why this is happening is that correct? The issue with CSE here is that with RPO VN I made unvisited vars VARYING due to on-demand handling. While vn_visit_phis has special handling for undefs the hashtable insert/lookup do not. I am testing the following to rectify this (which then CSEs this PHI). diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index ae0172a143e..893b1d0ddaa 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -4499,7 +4499,12 @@ vn_phi_lookup (gimple *phi, bool backedges_varying_p) tree def =3D PHI_ARG_DEF_FROM_EDGE (phi, e); if (TREE_CODE (def) =3D=3D SSA_NAME && (!backedges_varying_p || !(e->flags & EDGE_DFS_BACK))) - def =3D SSA_VAL (def); + { + if (ssa_undefined_value_p (def, false)) + def =3D VN_TOP; + else + def =3D SSA_VAL (def); + } vp1->phiargs[e->dest_idx] =3D def; } vp1->type =3D TREE_TYPE (gimple_phi_result (phi)); @@ -4543,7 +4548,12 @@ vn_phi_insert (gimple *phi, tree result, bool backedges_varying_p) tree def =3D PHI_ARG_DEF_FROM_EDGE (phi, e); if (TREE_CODE (def) =3D=3D SSA_NAME && (!backedges_varying_p || !(e->flags & EDGE_DFS_BACK))) - def =3D SSA_VAL (def); + { + if (ssa_undefined_value_p (def, false)) + def =3D VN_TOP; + else + def =3D SSA_VAL (def); + } vp1->phiargs[e->dest_idx] =3D def; } vp1->value_id =3D VN_INFO (result)->value_id;=