aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2002-05-22 22:14:02 -0700
committerRichard Henderson <rth@gcc.gnu.org>2002-05-22 22:14:02 -0700
commit6f001fdf2ba997db95d256a07c77f08bff53f7a9 (patch)
treea95c355c9b7d6dc672c09986b98412c015285a30 /gcc
parenta70b54fd5610476c8d0e0b78c10af9f495dd42e2 (diff)
downloadgcc-6f001fdf2ba997db95d256a07c77f08bff53f7a9.zip
gcc-6f001fdf2ba997db95d256a07c77f08bff53f7a9.tar.gz
gcc-6f001fdf2ba997db95d256a07c77f08bff53f7a9.tar.bz2
varasm.c (default_section_type_flags): Check for VAR_DECL before using DECL_THREAD_LOCAL.
* varasm.c (default_section_type_flags): Check for VAR_DECL before using DECL_THREAD_LOCAL. * decl.c (obscure_complex_init): Check for VAR_DECL before using DECL_THREAD_LOCAL. From-SVN: r53761
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl.c2
-rw-r--r--gcc/varasm.c2
4 files changed, 12 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a668454..7225f39 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2002-05-22 Richard Henderson <rth@redhat.com>
+
+ * varasm.c (default_section_type_flags): Check for VAR_DECL
+ before using DECL_THREAD_LOCAL.
+
2002-05-22 David Edelsohn <edelsohn@gnu.org>
* config/rs6000/aix43.h (LINK_SPEC): Add PE initializer.
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 69008fd..346add8 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,10 @@
2002-05-22 Richard Henderson <rth@redhat.com>
+ * decl.c (obscure_complex_init): Check for VAR_DECL
+ before using DECL_THREAD_LOCAL.
+
+2002-05-22 Richard Henderson <rth@redhat.com>
+
* decl.c (check_tag_decl): Handle RID_THREAD.
(obscure_complex_init): Reject run-time init of tls.
(grokvardecl, grokdeclarator): Handle RID_THREAD.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index dbdc6f2..dbaf685 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -7581,7 +7581,7 @@ static tree
obscure_complex_init (decl, init)
tree decl, init;
{
- if (DECL_THREAD_LOCAL (decl))
+ if (TREE_CODE (decl) == VAR_DECL && DECL_THREAD_LOCAL (decl))
{
error ("run-time initialization of thread-local storage");
return NULL_TREE;
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 0c4b3cd..a055bbf 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -5105,7 +5105,7 @@ default_section_type_flags (decl, name, reloc)
if (decl && DECL_ONE_ONLY (decl))
flags |= SECTION_LINKONCE;
- if (decl && DECL_THREAD_LOCAL (decl))
+ if (decl && TREE_CODE (decl) == VAR_DECL && DECL_THREAD_LOCAL (decl))
flags |= SECTION_TLS | SECTION_WRITE;
if (strcmp (name, ".bss") == 0