varasm.c (default_section_type_flags): Check for VAR_DECL before using DECL_THREAD_LOCAL.
authorRichard Henderson <rth@redhat.com>
Thu, 23 May 2002 05:14:02 +0000 (22:14 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Thu, 23 May 2002 05:14:02 +0000 (22:14 -0700)
        * 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

gcc/ChangeLog
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/varasm.c

index a668454..7225f39 100644 (file)
@@ -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.
index 69008fd..346add8 100644 (file)
@@ -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.
index dbdc6f2..dbaf685 100644 (file)
@@ -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;
index 0c4b3cd..a055bbf 100644 (file)
@@ -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