From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BEF47387090F; Tue, 5 May 2020 11:04:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BEF47387090F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1588676682; bh=ZfOzzaQDPIT+TA/6wQQ1on8ZReI4kIuiO8cp/yAfH7c=; h=From:To:Subject:Date:In-Reply-To:References:From; b=RYdEaVaAhXKX2ydvJsriahiJ+k7LM9dRe75wsJeDp/x7QK8L0U7c1SlLEpfrCCMZv uA+UYadgT78dwcqRJpKhaDZ5Ax3BUIuhYCfFfUrucNnW3crReBvLrJQ1aLNULsMe1f X6uU5zvPfyrwx5hQggSiKcBl2vWx3q1GHWJyiE6k= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/94947] [8/9/10/11 Regression] -fipa-pta + pthread_once crash since r6-5684-g47e5754e17e9ac3b Date: Tue, 05 May 2020 11:04:42 +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: 9.3.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 8.5 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: Tue, 05 May 2020 11:04:42 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94947 --- Comment #4 from Richard Biener --- (In reply to Richard Biener from comment #3) > In fact this situation doesn't seem to be handled at all - global variabl= es > are still an afterthought in IPA-PTA it seems. Needs more work than a > simple fix. Hum, actually it's a simple bug and the following fixes it. diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 416a26c996c..16a2b53c2b7 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -8187,8 +8187,8 @@ ipa_pta_execute (void) /* For the purpose of IPA PTA unit-local globals are not escape points. */ - bool nonlocal_p =3D (var->used_from_other_partition - || var->externally_visible + bool nonlocal_p =3D (var->externally_visible_p () + || var->used_from_other_partition || var->force_output); var->call_for_symbol_and_aliases (refered_from_nonlocal_var, &nonlocal_p, true);=