summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2007-07-14 08:43:48 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2007-07-14 08:43:48 +0000
commit6f1777383337b71b6d5c5253347ec9002506f766 (patch)
tree4bfc8405f2aee189e4f82ced2f4657732db9b84a
parent5090788d21347c75b5041a179c29e21344a457b2 (diff)
downloadgcc-6f1777383337b71b6d5c5253347ec9002506f766.tar.gz
PR tree-optimization/32705
* tree-ssa-sccvn.c (set_ssa_val_to): Accept VN_TOP as value number. (simplify_binary_expression): Use SSA_VAL consistently. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126637 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-ssa-sccvn.c14
2 files changed, 14 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1057ccba8b1..4002720655f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2007-07-14 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR tree-optimization/32705
+ * tree-ssa-sccvn.c (set_ssa_val_to): Accept VN_TOP as value number.
+ (simplify_binary_expression): Use SSA_VAL consistently.
+
2007-07-13 David Edelsohn <edelsohn@gnu.org>
* config/rs6000/spe.md (SPE_ACC_REGNO): Delete definition.
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index a04bb2157bf..53e680c383a 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -1017,11 +1017,13 @@ static inline bool
set_ssa_val_to (tree from, tree to)
{
tree currval;
- gcc_assert (to != NULL);
- /* The only thing we allow as value numbers are ssa_names and
- invariants. So assert that here. */
- gcc_assert (TREE_CODE (to) == SSA_NAME || is_gimple_min_invariant (to));
+ /* The only thing we allow as value numbers are VN_TOP, ssa_names
+ and invariants. So assert that here. */
+ gcc_assert (to != NULL_TREE
+ && (to == VN_TOP
+ || TREE_CODE (to) == SSA_NAME
+ || is_gimple_min_invariant (to)));
if (dump_file && (dump_flags & TDF_DETAILS))
{
@@ -1389,7 +1391,7 @@ simplify_binary_expression (tree rhs)
if (VN_INFO (op0)->has_constants)
op0 = valueize_expr (VN_INFO (op0)->expr);
else if (SSA_VAL (op0) != VN_TOP && SSA_VAL (op0) != op0)
- op0 = VN_INFO (op0)->valnum;
+ op0 = SSA_VAL (op0);
}
if (TREE_CODE (op1) == SSA_NAME)
@@ -1397,7 +1399,7 @@ simplify_binary_expression (tree rhs)
if (VN_INFO (op1)->has_constants)
op1 = valueize_expr (VN_INFO (op1)->expr);
else if (SSA_VAL (op1) != VN_TOP && SSA_VAL (op1) != op1)
- op1 = VN_INFO (op1)->valnum;
+ op1 = SSA_VAL (op1);
}
result = fold_binary (TREE_CODE (rhs), TREE_TYPE (rhs), op0, op1);