From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E925C3858C62; Sat, 22 Oct 2022 11:17:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E925C3858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666437460; bh=G6LRMRprexM67VNtwuqu131iUwpAKnmLsbixTY5rhso=; h=From:To:Subject:Date:In-Reply-To:References:From; b=SowRerHPeGlKdLASNHWaVjoJAOAsIPiadijJ+gQcggvqByMvQZTFEojq6qZy2Us7b GbZoxu8a8qmHFvtAm13ggrWlPBzcB/CvFheZqwKiNAbTGZ36Wh8eDzo0iSxSaBSyib LoepjUI0iRuHrttmIksockGo01UHNokNjgwsmoIE= From: "iains at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug other/107353] [13 regression] Numerous ICEs after r13-3416-g1d561e1851c466 Date: Sat, 22 Oct 2022 11:17:39 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: other X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: iains at gcc dot gnu.org 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107353 --- Comment #4 from Iain Sandoe --- Emulated TLS targets can test targetm.have_tls. The patch below fixes the fails on Fortran for x86_64-darwin, libgomp in te= st now. I do not really like that it means pulling in the whole of target.h, and imagine that this will not fix the powerpc64le-linux-gnu cases? The TLS varieties are "ELF" (AFAIU).. so this would not fix things if/when I implement native TLS on Darwin (since that has Mach-O semantics for TLS). so, perhaps there's a better test (or we should make the targetm test more fine-grained). In any event we should not test things that pertain to the platform in the inner loop - but either punt on the whole opt (or choose a different flavour) for other targets. diff --git a/gcc/ipa-visibility.cc b/gcc/ipa-visibility.cc index 3ed2b7cf679..acea49f8b1f 100644 --- a/gcc/ipa-visibility.cc +++ b/gcc/ipa-visibility.cc @@ -86,6 +86,7 @@ along with GCC; see the file COPYING3. If not see #include "ipa-utils.h" #include "stringpool.h" #include "attribs.h" +#include "target.h" /* Return true when NODE cannot be local. Worker for cgraph_local_node_p. = */ @@ -873,7 +874,7 @@ function_and_variable_visibility (bool whole_program) } } - if (symtab->state >=3D IPA_SSA) + if (symtab->state >=3D IPA_SSA && targetm.have_tls) { FOR_EACH_VARIABLE (vnode) {=