tree.c (recompute_tree_invarant_for_addr_expr): The address of a thread-local variabl...
authorAldy Hernandez <aldyh@redhat.com>
Wed, 24 Nov 2004 16:37:02 +0000 (16:37 +0000)
committerAldy Hernandez <aldyh@gcc.gnu.org>
Wed, 24 Nov 2004 16:37:02 +0000 (16:37 +0000)
* tree.c (recompute_tree_invarant_for_addr_expr): The address of a
thread-local variable is invariant.

From-SVN: r91174

gcc/ChangeLog
gcc/tree.c

index 9d9423452f06b6c077cb55d306849d494b1717c8..7d5bae227f3548bf7097f474f6883489d6b5b76f 100644 (file)
@@ -1,3 +1,8 @@
+2004-11-24  Aldy Hernandez  <aldyh@redhat.com>
+
+       * tree.c (recompute_tree_invarant_for_addr_expr): The address of a
+       thread-local variable is invariant.
+
 2004-11-24  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
        * tree-pretty-print.c (dump_generic_node, case POINTER_TYPE):
index 643f1def6e4dcd5199a76688c6535593dbc86c34..9fb3628261d6c2ac7d8814c43d6be7b1c477a967 100644 (file)
@@ -2421,7 +2421,9 @@ do { tree _node = (NODE); \
     {
       if (staticp (node))
        ;
-      else if (decl_function_context (node) == current_function_decl)
+      else if (decl_function_context (node) == current_function_decl
+              /* Addresses of thread-local variables are invariant.  */
+              || (TREE_CODE (node) == VAR_DECL && DECL_THREAD_LOCAL (node)))
        tc = false;
       else
        ti = tc = false;