]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-flow-inline.h (var_ann): External variable annotations are unshared too.
authorJan Hubicka <jh@suse.cz>
Sat, 23 Dec 2006 00:27:44 +0000 (01:27 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sat, 23 Dec 2006 00:27:44 +0000 (00:27 +0000)
* tree-flow-inline.h (var_ann): External variable annotations are
unshared too.
(tree_common_ann): Handle correctly unshared variables annotations.
* tree-dfa.c (create_var_ann): External variable annotations are
unshared too.

From-SVN: r120164

gcc/ChangeLog
gcc/tree-dfa.c
gcc/tree-flow-inline.h

index 1c10a149495607b39af6351cc8708e2f8ff9b56e..be8a3f568be78b446d17bfc1b4068399eb4fefd0 100644 (file)
@@ -1,3 +1,11 @@
+2006-12-23  Jan Hubicka  <jh@suse.cz>
+
+       * tree-flow-inline.h (var_ann): External variable annotations are
+       unshared too.
+       (tree_common_ann): Handle correctly unshared variables annotations.
+       * tree-dfa.c (create_var_ann): External variable annotations are
+       unshared too.
+
 2006-12-22  Kazu Hirata  <kazu@codesourcery.com>
 
        * basic-block.h: Remove the prototype for
index 9c30eb53e1914463a16dadad1fb8267a0cd433d0..59899f17f77aaccf2ae8abddd518de66d9c4687f 100644 (file)
@@ -130,7 +130,7 @@ create_var_ann (tree t)
   gcc_assert (DECL_P (t));
   gcc_assert (!t->base.ann || t->base.ann->common.type == VAR_ANN);
 
-  if (TREE_STATIC (t))
+  if (!MTAG_P (t) && (TREE_STATIC (t) || DECL_EXTERNAL (t)))
     {
       sann = GGC_CNEW (struct static_var_ann_d);
       ann = &sann->ann;
@@ -140,7 +140,7 @@ create_var_ann (tree t)
 
   ann->common.type = VAR_ANN;
 
-  if (TREE_STATIC (t))
+  if (!MTAG_P (t) && (TREE_STATIC (t) || DECL_EXTERNAL (t)))
     {
        void **slot;
        sann->uid = DECL_UID (t);
@@ -696,7 +696,7 @@ set_default_def (tree var, tree def)
       htab_remove_elt (DEFAULT_DEFS (cfun), *loc);
       return;
     }
-  gcc_assert (TREE_CODE (def) == SSA_NAME);
+  gcc_assert (!def || TREE_CODE (def) == SSA_NAME);
   loc = htab_find_slot_with_hash (DEFAULT_DEFS (cfun), &in,
                                   DECL_UID (var), INSERT);
 
index d87adc3911248975f5011ec54f90c590fba2ea60..0695c6562939b991135a5bb3106f02bdd5427be7 100644 (file)
@@ -203,7 +203,7 @@ var_ann (tree t)
   gcc_assert (t);
   gcc_assert (DECL_P (t));
   gcc_assert (TREE_CODE (t) != FUNCTION_DECL);
-  if (TREE_STATIC (t))
+  if (!MTAG_P (t) && (TREE_STATIC (t) || DECL_EXTERNAL (t)))
     {
       struct static_var_ann_d *sann
         = ((struct static_var_ann_d *)
@@ -952,6 +952,9 @@ clear_call_clobbered (tree var)
 static inline tree_ann_common_t
 tree_common_ann (tree t)
 {
+  /* Watch out static variables with unshared annotations.  */
+  if (DECL_P (t) && TREE_CODE (t) == VAR_DECL)
+    return &var_ann (t)->common;
   return &t->base.ann->common;
 }