aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ccp.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2016-10-07 13:47:40 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2016-10-07 13:47:40 +0000
commitd7f336f846f4333c3e55cc222fba21b4bc154119 (patch)
tree4f3aacf0249259991ac7ae2c63b406c8b1311937 /gcc/tree-ssa-ccp.c
parenta9172bf307dd49fa001387f4b514ea49d38f2092 (diff)
downloadgcc-d7f336f846f4333c3e55cc222fba21b4bc154119.zip
gcc-d7f336f846f4333c3e55cc222fba21b4bc154119.tar.gz
gcc-d7f336f846f4333c3e55cc222fba21b4bc154119.tar.bz2
tree-ssa-propagate.c (replace_phi_args_in): Remove no longer required hack.
2016-10-07 Richard Biener <rguenther@suse.de> * tree-ssa-propagate.c (replace_phi_args_in): Remove no longer required hack. (substitute_and_fold_dom_walker::before_dom_children): Substitute and fold before pass specific folding to avoid feeding that with SSA names that will be later released. * tree-ssa-ccp.c (get_value_for_expr): Guard for new SSA names introduced by folding and visited by evaluate_stmt called during ccp_fold_stmt. (likely_value): Likewise. (evaluate_stmt): Likewise. * tree-vrp.c (simplify_truth_ops_using_ranges): Fold modified stmt. (simplify_div_or_mod_using_ranges): Likewise. (simplify_min_or_max_using_ranges): Likewise. (simplify_abs_using_ranges): Likewise. (simplify_conversion_using_ranges): Likewise. (simplify_float_conversion_using_ranges): Likewise. (simplify_stmt_using_ranges): Likewise. * gcc.dg/tree-ssa/vrp01.c: Adjust. * gcc.dg/tree-ssa/vrp34.c: Likewise. From-SVN: r240865
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r--gcc/tree-ssa-ccp.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index 3dc9ffa..fe9a313 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -591,7 +591,15 @@ get_value_for_expr (tree expr, bool for_bits_p)
if (TREE_CODE (expr) == SSA_NAME)
{
- val = *get_value (expr);
+ ccp_prop_value_t *val_ = get_value (expr);
+ if (val_)
+ val = *val_;
+ else
+ {
+ val.lattice_val = VARYING;
+ val.value = NULL_TREE;
+ val.mask = -1;
+ }
if (for_bits_p
&& val.lattice_val == CONSTANT
&& TREE_CODE (val.value) == ADDR_EXPR)
@@ -673,12 +681,12 @@ likely_value (gimple *stmt)
{
ccp_prop_value_t *val = get_value (use);
- if (val->lattice_val == UNDEFINED)
+ if (val && val->lattice_val == UNDEFINED)
has_undefined_operand = true;
else
all_undefined_operands = false;
- if (val->lattice_val == CONSTANT)
+ if (val && val->lattice_val == CONSTANT)
has_constant_operand = true;
if (SSA_NAME_IS_DEFAULT_DEF (use)
@@ -1739,11 +1747,11 @@ evaluate_stmt (gimple *stmt)
simplified = ccp_fold (stmt);
if (simplified && TREE_CODE (simplified) == SSA_NAME)
{
- val = *get_value (simplified);
- if (val.lattice_val != VARYING)
+ ccp_prop_value_t *val = get_value (simplified);
+ if (val && val->lattice_val != VARYING)
{
fold_undefer_overflow_warnings (true, stmt, 0);
- return val;
+ return *val;
}
}
is_constant = simplified && is_gimple_min_invariant (simplified);