diff options
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r-- | gcc/cp/decl2.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index a7a6efb25f2..0332aa239a4 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -1164,6 +1164,10 @@ is_late_template_attribute (tree attr, tree decl) if (is_attribute_p ("unused", name)) return false; + /* Attribute tls_model wants to modify the symtab. */ + if (is_attribute_p ("tls_model", name)) + return true; + /* #pragma omp declare simd attribute needs to be always deferred. */ if (flag_openmp && is_attribute_p ("omp declare simd", name)) @@ -3005,6 +3009,7 @@ get_guard (tree decl) TREE_STATIC (guard) = TREE_STATIC (decl); DECL_COMMON (guard) = DECL_COMMON (decl); DECL_COMDAT (guard) = DECL_COMDAT (decl); + CP_DECL_THREAD_LOCAL_P (guard) = CP_DECL_THREAD_LOCAL_P (decl); set_decl_tls_model (guard, DECL_TLS_MODEL (decl)); if (DECL_ONE_ONLY (decl)) make_decl_one_only (guard, cxx_comdat_group (guard)); @@ -3143,7 +3148,7 @@ static bool var_needs_tls_wrapper (tree var) { return (!error_operand_p (var) - && DECL_THREAD_LOCAL_P (var) + && CP_DECL_THREAD_LOCAL_P (var) && !DECL_GNU_TLS_P (var) && !DECL_FUNCTION_SCOPE_P (var) && !var_defined_without_dynamic_init (var)); @@ -4278,6 +4283,7 @@ handle_tls_init (void) DECL_ARTIFICIAL (guard) = true; DECL_IGNORED_P (guard) = true; TREE_USED (guard) = true; + CP_DECL_THREAD_LOCAL_P (guard) = true; set_decl_tls_model (guard, decl_default_tls_model (guard)); pushdecl_top_level_and_finish (guard, NULL_TREE); |