aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-sccvn.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2008-11-02 13:34:58 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2008-11-02 13:34:58 +0000
commit8495c94f4981e8018b6da421e1e25b82ebdde91e (patch)
tree8c0e73b01869af871ad88b8619d5546944121409 /gcc/tree-ssa-sccvn.c
parent99f9aa7b91375574fce9390624b55fcae66c9f38 (diff)
downloadgcc-8495c94f4981e8018b6da421e1e25b82ebdde91e.zip
gcc-8495c94f4981e8018b6da421e1e25b82ebdde91e.tar.gz
gcc-8495c94f4981e8018b6da421e1e25b82ebdde91e.tar.bz2
re PR tree-optimization/37991 (excessive memory consumption - possible hang)
2008-11-02 Richard Guenther <rguenther@suse.de> PR tree-optimization/37991 * tree-ssa-sccvn.h (copy_vuses_from_stmt): Remove. * tree-ssa-sccvn.c (copy_vuses_from_stmt): Make static. (set_ssa_val_to): Print if the value changed. (simplify_binary_expression): Strip useless conversions. * gcc.c-torture/compile/pr37991.c: New testcase. From-SVN: r141532
Diffstat (limited to 'gcc/tree-ssa-sccvn.c')
-rw-r--r--gcc/tree-ssa-sccvn.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 082a278..e255411 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -498,7 +498,7 @@ vuses_to_vec (gimple stmt, VEC (tree, gc) **result)
/* Copy the VUSE names in STMT into a vector, and return
the vector. */
-VEC (tree, gc) *
+static VEC (tree, gc) *
copy_vuses_from_stmt (gimple stmt)
{
VEC (tree, gc) *vuses = NULL;
@@ -1579,7 +1579,6 @@ set_ssa_val_to (tree from, tree to)
print_generic_expr (dump_file, from, 0);
fprintf (dump_file, " to ");
print_generic_expr (dump_file, to, 0);
- fprintf (dump_file, "\n");
}
currval = SSA_VAL (from);
@@ -1587,8 +1586,12 @@ set_ssa_val_to (tree from, tree to)
if (currval != to && !operand_equal_p (currval, to, OEP_PURE_SAME))
{
SSA_VAL (from) = to;
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, " (changed)\n");
return true;
}
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, "\n");
return false;
}
@@ -2113,6 +2116,8 @@ simplify_binary_expression (gimple stmt)
result = fold_binary (gimple_assign_rhs_code (stmt),
TREE_TYPE (gimple_get_lhs (stmt)), op0, op1);
+ if (result)
+ STRIP_USELESS_TYPE_CONVERSION (result);
fold_undefer_overflow_warnings (result && valid_gimple_rhs_p (result),
stmt, 0);