tree-into-ssa.c (update_ssa): Verify we do not rename symbols that are already partly...
authorRichard Guenther <rguenther@suse.de>
Tue, 14 Aug 2012 09:32:06 +0000 (09:32 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 14 Aug 2012 09:32:06 +0000 (09:32 +0000)
2012-08-14  Richard Guenther  <rguenther@suse.de>

* tree-into-ssa.c (update_ssa): Verify we do not rename
symbols that are already partly in SSA form.

From-SVN: r190377

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

index f24b84ae4072bec9a40d79c081ba1dc401ddc5e7..b0cb30889fa2f72debb7a6f2c145fc38804a1a20 100644 (file)
@@ -1,3 +1,8 @@
+2012-08-14  Richard Guenther  <rguenther@suse.de>
+
+       * tree-into-ssa.c (update_ssa): Verify we do not rename
+       symbols that are already partly in SSA form.
+
 2012-08-14  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/53411
index e62e3fe35cca4a90b2b9f70b3222ef7811089143..50e2eff5df88ac250564f814f3e1eda11d1f2f07 100644 (file)
@@ -3247,6 +3247,30 @@ update_ssa (unsigned update_flags)
         statements and set local live-in information for the PHI
         placement heuristics.  */
       prepare_block_for_update (start_bb, insert_phi_p);
+
+#ifdef ENABLE_CHECKING
+      for (i = 1; i < num_ssa_names; ++i)
+       {
+         tree name = ssa_name (i);
+         if (!name
+             || virtual_operand_p (name))
+           continue;
+
+         /* For all but virtual operands, which do not have SSA names
+            with overlapping life ranges, ensure that symbols marked
+            for renaming do not have existing SSA names associated with
+            them as we do not re-write them out-of-SSA before going
+            into SSA for the remaining symbol uses.  */
+         if (marked_for_renaming (SSA_NAME_VAR (name)))
+           {
+             fprintf (stderr, "Existing SSA name for symbol marked for "
+                      "renaming: ");
+             print_generic_expr (stderr, name, TDF_SLIM);
+             fprintf (stderr, "\n");
+             internal_error ("SSA corruption");
+           }
+       }
+#endif
     }
   else
     {