https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99466
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Iain Buclaw <ibuc...@gcc.gnu.org>: https://gcc.gnu.org/g:8f5e18db259c8a9790feb1d73bb0348182264f15 commit r11-7849-g8f5e18db259c8a9790feb1d73bb0348182264f15 Author: Iain Buclaw <ibuc...@gdcproject.org> Date: Sat Mar 13 17:05:52 2021 +0100 Fix ICE: in function_and_variable_visibility, at ipa-visibility.c:795 [PR99466] In get_emutls_init_templ_addr, only thread-local declarations that were DECL_ONE_ONLY would have a public initializer symbol, ignoring variables that were declared with __attribute__((weak)). gcc/ChangeLog: PR ipa/99466 * tree-emutls.c (get_emutls_init_templ_addr): Mark initializer of weak TLS declarations as public. gcc/testsuite/ChangeLog: PR ipa/99466 * gcc.dg/tls/pr99466-1.c: New test. * gcc.dg/tls/pr99466-2.c: New test.