tree-into-ssa.c (rewrite_ssa_into_ssa): Expect ssa_name to return NULL.
authorJan Hubicka <jh@suse.cz>
Sat, 18 Sep 2004 07:31:30 +0000 (09:31 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sat, 18 Sep 2004 07:31:30 +0000 (07:31 +0000)
* tree-into-ssa.c (rewrite_ssa_into_ssa):  Expect ssa_name to return
NULL.
* tree-ssa-alias.c (init_alias_info): Likewise.
* tree-ssa.c (verify_flow_sensitive_alias_info): Likewise.
(verify_ssa): Likewise.
* tree-ssanames.c (make_ssa_name): Clear out ssa_names arrays.

From-SVN: r87698

gcc/ChangeLog
gcc/tree-into-ssa.c
gcc/tree-ssa-alias.c
gcc/tree-ssa.c
gcc/tree-ssanames.c

index 9fa0b9b7cedef2f05745f9a0004b2b90c6920f8f..a69ec4bb8166cc76588360b4ecc7a747e1cf1fdd 100644 (file)
@@ -1,3 +1,12 @@
+2004-09-18  Jan Hubicka  <jh@suse.cz>
+
+       * tree-into-ssa.c (rewrite_ssa_into_ssa):  Expect ssa_name to return
+       NULL.
+       * tree-ssa-alias.c (init_alias_info): Likewise.
+       * tree-ssa.c (verify_flow_sensitive_alias_info): Likewise.
+       (verify_ssa): Likewise.
+       * tree-ssanames.c (make_ssa_name): Clear out ssa_names arrays.
+
 2004-09-18  Jan Hubicka  <jh@suse.cz>
 
        * i386.c (legitimize_pic_address): Fix splitting of PLUS with
index 5a49d7f7d09a1a50e50ac2972a2f062b7568ba77..e71eb4745aaae72275cee31437cf7a6c47f93ecd 100644 (file)
@@ -1623,7 +1623,8 @@ rewrite_ssa_into_ssa (void)
   sbitmap_free (mark_def_sites_global_data.kills);
 
   for (i = 1; i < num_ssa_names; i++)
-    set_current_def (ssa_name (i), NULL_TREE);
+    if (ssa_name (i))
+      set_current_def (ssa_name (i), NULL_TREE);
 
   /* Insert PHI nodes at dominance frontiers of definition blocks.  */
   insert_phi_nodes (dfs, to_rename);
@@ -1679,7 +1680,7 @@ rewrite_ssa_into_ssa (void)
   for (i = 1; i < num_ssa_names; i++)
     {
       name = ssa_name (i);
-      if (!SSA_NAME_AUX (name))
+      if (!name || !SSA_NAME_AUX (name))
        continue;
 
       free (SSA_NAME_AUX (name));
index ae06ea0680bcbd48bef7fdf9c10789b14288f2af..ff1dd7726aada2501bddab216e3a2c034fca9ab7 100644 (file)
@@ -414,7 +414,7 @@ init_alias_info (void)
        {
          tree name = ssa_name (i);
 
-         if (!POINTER_TYPE_P (TREE_TYPE (name)))
+         if (!name || !POINTER_TYPE_P (TREE_TYPE (name)))
            continue;
 
          if (SSA_NAME_PTR_INFO (name))
index 21dc59aac0210fffdde8fa116dabf140257d411d..2c5cf5ab160188f438997f14a37cc323c0ca3cfe 100644 (file)
@@ -419,6 +419,8 @@ verify_flow_sensitive_alias_info (void)
       struct ptr_info_def *pi;
 
       ptr = ssa_name (i);
+      if (!ptr)
+       continue;
       ann = var_ann (SSA_NAME_VAR (ptr));
       pi = SSA_NAME_PTR_INFO (ptr);
 
@@ -466,25 +468,26 @@ verify_flow_sensitive_alias_info (void)
          size_t j;
 
          for (j = i + 1; j < num_ssa_names; j++)
-           {
-             tree ptr2 = ssa_name (j);
-             struct ptr_info_def *pi2 = SSA_NAME_PTR_INFO (ptr2);
-
-             if (!TREE_VISITED (ptr2) || !POINTER_TYPE_P (TREE_TYPE (ptr2)))
-               continue;
-
-             if (pi2
-                 && pi2->name_mem_tag
-                 && pi2->pt_vars
-                 && bitmap_first_set_bit (pi2->pt_vars) >= 0
-                 && pi->name_mem_tag != pi2->name_mem_tag
-                 && bitmap_equal_p (pi->pt_vars, pi2->pt_vars))
-               {
-                 error ("Two pointers with different name tags and identical points-to sets");
-                 debug_variable (ptr2);
-                 goto err;
-               }
-           }
+           if (ssa_name (j))
+             {
+               tree ptr2 = ssa_name (j);
+               struct ptr_info_def *pi2 = SSA_NAME_PTR_INFO (ptr2);
+
+               if (!TREE_VISITED (ptr2) || !POINTER_TYPE_P (TREE_TYPE (ptr2)))
+                 continue;
+
+               if (pi2
+                   && pi2->name_mem_tag
+                   && pi2->pt_vars
+                   && bitmap_first_set_bit (pi2->pt_vars) >= 0
+                   && pi->name_mem_tag != pi2->name_mem_tag
+                   && bitmap_equal_p (pi->pt_vars, pi2->pt_vars))
+                 {
+                   error ("Two pointers with different name tags and identical points-to sets");
+                   debug_variable (ptr2);
+                   goto err;
+                 }
+             }
        }
     }
 
@@ -524,7 +527,8 @@ verify_ssa (void)
 
   /* Keep track of SSA names present in the IL.  */
   for (i = 1; i < num_ssa_names; i++)
-    TREE_VISITED (ssa_name (i)) = 0;
+    if (ssa_name (i))
+      TREE_VISITED (ssa_name (i)) = 0;
 
   calculate_dominance_info (CDI_DOMINATORS);
 
index 55ba145c35ae659cae7bfcf256d0ee2b104cf27a..cc12f28d7d47f5d7eaa8372f2536f3fa3e110c7e 100644 (file)
@@ -205,6 +205,8 @@ make_ssa_name (tree var, tree stmt)
       memset (t, 0, tree_size (t));
       TREE_SET_CODE (t, SSA_NAME);
       SSA_NAME_VERSION (t) = save_version;
+      gcc_assert (ssa_name (save_version) == NULL);
+      VARRAY_TREE (ssa_names, save_version) = t;
     }
   else
     {
@@ -260,6 +262,7 @@ release_ssa_name (tree var)
      defining statement.  */
   if (! SSA_NAME_IN_FREE_LIST (var))
     {
+      VARRAY_TREE (ssa_names, SSA_NAME_VERSION (var)) = NULL;
       SSA_NAME_IN_FREE_LIST (var) = 1;
       TREE_CHAIN (var) = free_ssanames;
       free_ssanames = var;