From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D28143858432; Fri, 15 Oct 2021 13:54:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D28143858432 From: "hubicka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/102720] [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4324 Date: Fri, 15 Oct 2021 13:54:17 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka 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, 15 Oct 2021 13:54:17 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102720 --- Comment #11 from Jan Hubicka --- Aha, the problem is in the way I updated computing use/clobber sets. I accidentally disabled code that copies the solution from solver local representation into the final form. As a result we failed to update the call uses while doing the late alias pass and ended up with stale decl from first run. Honza diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 6f12a66ee0d..ebb4ea78674 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -379,7 +379,7 @@ new_var_info (tree t, const char *name, bool add_id) if (dump_file && add_id) { - char *tempname =3D xasprintf ("%s(%d)", name, index); + char *tempname =3D xasprintf ("%s(%d,%d)", name, index, t?DECL_UID (t):-1); name =3D ggc_strdup (tempname); free (tempname); } @@ -7541,17 +7541,18 @@ compute_points_to_sets (void) determine_global_memory_access (stmt, NULL, &reads_global_memory, &uses_global_memory); - if (!uses_global_memory) - ; - else if ((vi =3D lookup_call_use_vi (stmt)) !=3D NULL) + if ((vi =3D lookup_call_use_vi (stmt)) !=3D NULL) { *pt =3D find_what_var_points_to (cfun->decl, vi); /* Escaped (and thus nonlocal) variables are always implicitly used by calls. */ /* ??? ESCAPED can be empty even though NONLOCAL always escaped. */ - pt->nonlocal =3D uses_global_memory; - pt->escaped =3D uses_global_memory; + if (uses_global_memory) + { + pt->nonlocal =3D uses_global_memory; + pt->escaped =3D uses_global_memory; + } } else if (uses_global_memory) { @@ -7572,17 +7573,18 @@ compute_points_to_sets (void) determine_global_memory_access (stmt, &writes_global_memory, NULL, NULL); - if (!writes_global_memory) - ; - else if ((vi =3D lookup_call_clobber_vi (stmt)) !=3D NULL) + if ((vi =3D lookup_call_clobber_vi (stmt)) !=3D NULL) { *pt =3D find_what_var_points_to (cfun->decl, vi); /* Escaped (and thus nonlocal) variables are always implicitly clobbered by calls. */ /* ??? ESCAPED can be empty even though NONLOCAL always escaped. */ - pt->nonlocal =3D writes_global_memory; - pt->escaped =3D writes_global_memory; + if (writes_global_memory) + { + pt->nonlocal =3D writes_global_memory; + pt->escaped =3D writes_global_memory; + } } else if (writes_global_memory) {=