OSDN Git Service

2005-05-31 Andrew Pinski <pinskia@physics.uc.edu>
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 31 May 2005 16:29:16 +0000 (16:29 +0000)
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 31 May 2005 16:29:16 +0000 (16:29 +0000)
        PR tree-opt/21732
        * tree-ssa-copy.c (dump_copy_of): Create a bitmap and don't visit a
        SSA_NAME twice and cause the loop to become finite.  Remove the test
        for val.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100396 138bc75d-0d04-0410-961f-82ee72b054a4

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

index c54190f..25cd8c6 100644 (file)
@@ -1,5 +1,12 @@
 2005-05-31  Andrew Pinski  <pinskia@physics.uc.edu>
 
+       PR tree-opt/21732
+       * tree-ssa-copy.c (dump_copy_of): Create a bitmap and don't visit a
+       SSA_NAME twice and cause the loop to become finite.  Remove the test
+       for val.
+
+2005-05-31  Andrew Pinski  <pinskia@physics.uc.edu>
+
        * tree-cfg.c (verify_expr): Add checking for COND_EXPR's conditional
        expression.
 
index 5f4033d..8e2b536 100644 (file)
@@ -475,24 +475,30 @@ static void
 dump_copy_of (FILE *dump_file, tree var)
 {
   tree val;
+  sbitmap visited;
 
   print_generic_expr (dump_file, var, dump_flags);
 
   if (TREE_CODE (var) != SSA_NAME)
     return;
-
+    
+  visited = sbitmap_alloc (num_ssa_names);
+  SET_BIT (visited, SSA_NAME_VERSION (var));
+  
   fprintf (dump_file, " copy-of chain: ");
 
   val = var;
   print_generic_expr (dump_file, val, 0);
   fprintf (dump_file, " ");
-  while (copy_of[SSA_NAME_VERSION (val)].value
-         && copy_of[SSA_NAME_VERSION (val)].value != val)
+  while (copy_of[SSA_NAME_VERSION (val)].value)
     {
       fprintf (dump_file, "-> ");
       val = copy_of[SSA_NAME_VERSION (val)].value;
       print_generic_expr (dump_file, val, 0);
       fprintf (dump_file, " ");
+      if (TEST_BIT (visited, SSA_NAME_VERSION (val)))
+        break;
+      SET_BIT (visited, SSA_NAME_VERSION (val));
     }
 
   val = get_copy_of_val (var)->value;
@@ -502,6 +508,8 @@ dump_copy_of (FILE *dump_file, tree var)
     fprintf (dump_file, "[COPY]");
   else
     fprintf (dump_file, "[NOT A COPY]");
+  
+  sbitmap_free (visited);
 }