summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2016-12-07 22:51:48 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2016-12-07 22:51:48 +0000
commit9699a5ca4583aea62eac8f24086787ca65cdd220 (patch)
treed68a44bd4d4b92b8d853df0ab44dd9ab30f91eba
parent3925833e4490b7980b97e4a08ad48324ffcff92b (diff)
downloadgcc-9699a5ca4583aea62eac8f24086787ca65cdd220.tar.gz
Backported from mainline
2016-11-18 Jakub Jelinek <jakub@redhat.com> PR c++/77285 * mangle.c (mangle_tls_init_fn, mangle_tls_wrapper_fn): Call check_abi_tags. * g++.dg/tls/pr77285-1.C: New test. * g++.dg/tls/pr77285-2.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@243403 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/mangle.c2
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/g++.dg/tls/pr77285-1.C7
-rw-r--r--gcc/testsuite/g++.dg/tls/pr77285-2.C17
5 files changed, 38 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index f649cc776e6..15cd7cc05bc 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,6 +1,12 @@
2016-12-07 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
+ 2016-11-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/77285
+ * mangle.c (mangle_tls_init_fn, mangle_tls_wrapper_fn): Call
+ check_abi_tags.
+
2016-10-31 Jakub Jelinek <jakub@redhat.com>
PR c++/78089
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index ef864e733c0..23fd4efe12d 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -4068,6 +4068,7 @@ mangle_guard_variable (const tree variable)
tree
mangle_tls_init_fn (const tree variable)
{
+ check_abi_tags (variable);
start_mangling (variable);
write_string ("_ZTH");
write_guarded_var_name (variable);
@@ -4082,6 +4083,7 @@ mangle_tls_init_fn (const tree variable)
tree
mangle_tls_wrapper_fn (const tree variable)
{
+ check_abi_tags (variable);
start_mangling (variable);
write_string (TLS_WRAPPER_PREFIX);
write_guarded_var_name (variable);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 5fe69b66a90..bb1ba90b8dc 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,6 +1,12 @@
2016-12-07 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
+ 2016-11-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/77285
+ * g++.dg/tls/pr77285-1.C: New test.
+ * g++.dg/tls/pr77285-2.C: New test.
+
2016-11-16 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/78378
diff --git a/gcc/testsuite/g++.dg/tls/pr77285-1.C b/gcc/testsuite/g++.dg/tls/pr77285-1.C
new file mode 100644
index 00000000000..d8f69b2010c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/tls/pr77285-1.C
@@ -0,0 +1,7 @@
+// { dg-do link { target c++11 } }
+// { dg-require-effective-target tls }
+// { dg-additional-sources pr77285-2.C }
+
+struct __attribute__((abi_tag("tag"))) X { ~X () {} int i = 0; };
+thread_local X var1;
+X var2;
diff --git a/gcc/testsuite/g++.dg/tls/pr77285-2.C b/gcc/testsuite/g++.dg/tls/pr77285-2.C
new file mode 100644
index 00000000000..bac273a4d68
--- /dev/null
+++ b/gcc/testsuite/g++.dg/tls/pr77285-2.C
@@ -0,0 +1,17 @@
+// PR c++/77285
+// { dg-do compile { target c++11 } }
+// { dg-require-effective-target tls }
+// { dg-final { scan-assembler "_Z4var1B3tag" } }
+// { dg-final { scan-assembler "_Z4var2B3tag" } }
+// { dg-final { scan-assembler "_ZTH4var1B3tag" } }
+// { dg-final { scan-assembler "_ZTW4var1B3tag" } }
+
+struct __attribute__((abi_tag("tag"))) X { ~X () {} int i = 0; };
+extern thread_local X var1;
+extern X var2;
+
+int
+main ()
+{
+ return var1.i + var2.i;
+}