]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR debug/66653
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 30 Jun 2015 15:40:38 +0000 (15:40 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 30 Jun 2015 15:40:38 +0000 (15:40 +0000)
* decl2.c (is_late_template_attribute): True for tls_model.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@225193 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/decl2.c
gcc/testsuite/g++.dg/tls/tls_model1.C [new file with mode: 0644]

index cdb37c41fb75cc22c452faceb0792cd3943d228d..4d9b5a68cc44a8d20a97cfca42249c83c58913b6 100644 (file)
@@ -1,5 +1,8 @@
 2015-06-30  Jason Merrill  <jason@redhat.com>
 
+       PR debug/66653
+       * decl2.c (is_late_template_attribute): True for tls_model.
+
        PR debug/66653
        * cp-tree.h (CP_DECL_THREAD_LOCAL_P): New.
        (DECL_GNU_TLS_P): Use DECL_LANG_SPECIFIC field.
index 5032333c314d418aab23e1e3c40dc226cda93400..0332aa239a4c48b2993d2cefaaf95a40e187169b 100644 (file)
@@ -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))
diff --git a/gcc/testsuite/g++.dg/tls/tls_model1.C b/gcc/testsuite/g++.dg/tls/tls_model1.C
new file mode 100644 (file)
index 0000000..a1520a1
--- /dev/null
@@ -0,0 +1,8 @@
+// { dg-require-effective-target tls }
+// { dg-options "-g" }
+
+template <class T>
+void f()
+{
+  static __thread int i __attribute ((tls_model ("local-exec")));
+}