From 47297e51f5c84a72bbe4c1bf2542d1c859222d84 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Tue, 30 Jun 2015 11:40:38 -0400 Subject: [PATCH] re PR debug/66653 (ice in gen_type_die_with_usage, at dwarf2out.c:20876) PR debug/66653 * decl2.c (is_late_template_attribute): True for tls_model. From-SVN: r225193 --- gcc/cp/ChangeLog | 3 +++ gcc/cp/decl2.c | 4 ++++ gcc/testsuite/g++.dg/tls/tls_model1.C | 8 ++++++++ 3 files changed, 15 insertions(+) create mode 100644 gcc/testsuite/g++.dg/tls/tls_model1.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index cdb37c41fb7..4d9b5a68cc4 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2015-06-30 Jason Merrill + 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. diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 5032333c314..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)) diff --git a/gcc/testsuite/g++.dg/tls/tls_model1.C b/gcc/testsuite/g++.dg/tls/tls_model1.C new file mode 100644 index 00000000000..a1520a1ba2f --- /dev/null +++ b/gcc/testsuite/g++.dg/tls/tls_model1.C @@ -0,0 +1,8 @@ +// { dg-require-effective-target tls } +// { dg-options "-g" } + +template +void f() +{ + static __thread int i __attribute ((tls_model ("local-exec"))); +} -- 2.30.2