From: Jakub Jelinek Date: Fri, 18 Nov 2016 21:56:50 +0000 (+0100) Subject: re PR c++/77285 (extern thread_local linkage) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6c554a2ab8291d6f6c94325ea72cfbc7af3c1c55;p=gcc.git re PR c++/77285 (extern thread_local linkage) 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. From-SVN: r242607 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 68431bb7aaf..c26f1455a7a 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2016-11-18 Jakub Jelinek + + PR c++/77285 + * mangle.c (mangle_tls_init_fn, mangle_tls_wrapper_fn): Call + check_abi_tags. + 2016-11-18 Jason Merrill PR c++/67631 - list-init and explicit conversions diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index a4a2444ebfb..4fffe0bb4d2 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -4301,6 +4301,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); @@ -4315,6 +4316,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 729c2e980e0..c94d808a1de 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2016-11-18 Jakub Jelinek + + PR c++/77285 + * g++.dg/tls/pr77285-1.C: New test. + * g++.dg/tls/pr77285-2.C: New test. + 2016-11-18 Jeff Law PR target/25112 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; +}