summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-copy.c
diff options
context:
space:
mode:
authorAndrew Pinski <pinskia@physics.uc.edu>2005-05-31 16:29:16 +0000
committerAndrew Pinski <pinskia@gcc.gnu.org>2005-05-31 09:29:16 -0700
commitfb03baf21043a29fe3ca5bc66b06eb2b41ea2365 (patch)
treeed37254f074675713e8513c7affc7c3581455948 /gcc/tree-ssa-copy.c
parent8c7a0ea6ed41ee80a34b249e39108afb14195d89 (diff)
downloadgcc-fb03baf21043a29fe3ca5bc66b06eb2b41ea2365.tar.gz
re PR tree-optimization/21732 (-ftree-dump-all-details hangs during *.c.t24.copyprop or *.c.t38.copyprop2)
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. From-SVN: r100396
Diffstat (limited to 'gcc/tree-ssa-copy.c')
-rw-r--r--gcc/tree-ssa-copy.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/gcc/tree-ssa-copy.c b/gcc/tree-ssa-copy.c
index 5f4033d3a9b..8e2b53686a7 100644
--- a/gcc/tree-ssa-copy.c
+++ b/gcc/tree-ssa-copy.c
@@ -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);
}