From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4B8F73950438; Mon, 8 Mar 2021 14:19:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4B8F73950438 From: "ibuclaw at gdcproject dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/99466] internal compiler error: in function_and_variable_visibility, at ipa-visibility.c:795 Date: Mon, 08 Mar 2021 14:19:59 +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: 11.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: ibuclaw at gdcproject dot org X-Bugzilla-Status: WAITING 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 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: Mon, 08 Mar 2021 14:19:59 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99466 --- Comment #2 from Iain Buclaw --- (In reply to Martin Li=C5=A1ka from comment #1) > What compiler options do you use? No compiler options are necessary to reproduce the ICE. The symbol it fail= s on is ___emutls_t.tlsvar. Having a look at where this variable is created, it looks like TREE_PUBLIC = is copied for DECL_ONE_ONLY symbols, but not DECL_WEAK. --- a/gcc/tree-emutls.c +++ b/gcc/tree-emutls.c @@ -242,16 +242,18 @@ get_emutls_init_templ_addr (tree decl) DECL_PRESERVE_P (to) =3D DECL_PRESERVE_P (decl); DECL_WEAK (to) =3D DECL_WEAK (decl); - if (DECL_ONE_ONLY (decl)) + if (DECL_ONE_ONLY (decl) || DECL_WEAK (decl)) { TREE_STATIC (to) =3D TREE_STATIC (decl); TREE_PUBLIC (to) =3D TREE_PUBLIC (decl); DECL_VISIBILITY (to) =3D DECL_VISIBILITY (decl); - make_decl_one_only (to, DECL_ASSEMBLER_NAME (to)); } else TREE_STATIC (to) =3D 1; + if (DECL_ONE_ONLY (decl)) + make_decl_one_only (to, DECL_ASSEMBLER_NAME (to)); + DECL_VISIBILITY_SPECIFIED (to) =3D DECL_VISIBILITY_SPECIFIED (decl); DECL_INITIAL (to) =3D DECL_INITIAL (decl); DECL_INITIAL (decl) =3D NULL;=