commit 3c317cba2f2b6100987ee720f7d7da76f5f43c19
Author: Jason Merrill <jason@redhat.com>
Date: Tue Oct 9 12:55:52 2012 -0400
* decl.c (grokdeclarator): Set DECL_GNU_TLS_P for static data
members, too.
@@ -10446,7 +10446,11 @@ grokdeclarator (const cp_declarator *declarator,
DECL_EXTERNAL (decl) = 1;
if (thread_p)
- DECL_TLS_MODEL (decl) = decl_default_tls_model (decl);
+ {
+ DECL_TLS_MODEL (decl) = decl_default_tls_model (decl);
+ if (declspecs->gnu_thread_keyword_p)
+ DECL_GNU_TLS_P (decl) = true;
+ }
if (constexpr_p && !initialized)
{
@@ -1,6 +1,7 @@
// The reference temp should be TLS, not normal data.
// { dg-require-effective-target c++11 }
-// { dg-final { scan-assembler-not "\\.data" } }
+// { dg-require-alias }
+// { dg-final { scan-assembler-not "\\.data" { target tls_native } } }
extern int&& ir;
#pragma omp threadprivate (ir)
new file mode 100644
@@ -0,0 +1,18 @@
+// { dg-final { scan-assembler-not "_ZTHN1A1iE" } }
+// { dg-final { scan-assembler-not "_ZTWN1A1iE" } }
+// { dg-require-effective-target tls }
+
+struct A
+{
+ static __thread int i;
+};
+
+int
+test ()
+{
+ if (A::i != 8)
+ return 1;
+
+ A::i = 17;
+ return 0;
+}
@@ -2,7 +2,7 @@
// { dg-require-effective-target tls }
// The reference temp should be TLS, not normal data.
-// { dg-final { scan-assembler-not "\\.data" } }
+// { dg-final { scan-assembler-not "\\.data" { target tls_native } } }
void f()
{