diff options
author | Richard Guenther <rguenther@suse.de> | 2012-01-05 13:41:34 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2012-01-05 13:41:34 +0000 |
commit | 6ad024b4c0011de3a2c3a461e44f5e0ac3b70123 (patch) | |
tree | dfc04cfd1214b568092a48852182c24f30c0fd05 /gcc/tree-ssa-ccp.c | |
parent | 713b8dfb751d1d60e63b3005df128dc5cd3fd921 (diff) | |
download | gcc-6ad024b4c0011de3a2c3a461e44f5e0ac3b70123.zip gcc-6ad024b4c0011de3a2c3a461e44f5e0ac3b70123.tar.gz gcc-6ad024b4c0011de3a2c3a461e44f5e0ac3b70123.tar.bz2 |
re PR tree-optimization/51760 (ICE in set_lattice_value, at tree-ssa-ccp.c:456)
2012-01-05 Richard Guenther <rguenther@suse.de>
PR tree-optimization/51760
* tree-ssa-ccp.c (likely_value): Drop UNDEFINED to CONSTANT,
not VARYING.
(bit_value_unop): Handle UNDEFINED operands.
(bit_value_binop): Likewise.
* gcc.dg/torture/pr51760.c: New testcase.
From-SVN: r182909
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r-- | gcc/tree-ssa-ccp.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index 738606f..2080c06 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -657,9 +657,10 @@ likely_value (gimple stmt) } } /* If there was an UNDEFINED operand but the result may be not UNDEFINED - fall back to VARYING even if there were CONSTANT operands. */ + fall back to CONSTANT. During iteration UNDEFINED may still drop + to CONSTANT. */ if (has_undefined_operand) - return VARYING; + return CONSTANT; /* We do not consider virtual operands here -- load from read-only memory may have only VARYING virtual operands, but still be @@ -1368,6 +1369,10 @@ bit_value_unop (enum tree_code code, tree type, tree rhs) prop_value_t rval = get_value_for_expr (rhs, true); double_int value, mask; prop_value_t val; + + if (rval.lattice_val == UNDEFINED) + return rval; + gcc_assert ((rval.lattice_val == CONSTANT && TREE_CODE (rval.value) == INTEGER_CST) || double_int_minus_one_p (rval.mask)); @@ -1399,6 +1404,16 @@ bit_value_binop (enum tree_code code, tree type, tree rhs1, tree rhs2) prop_value_t r2val = get_value_for_expr (rhs2, true); double_int value, mask; prop_value_t val; + + if (r1val.lattice_val == UNDEFINED + || r2val.lattice_val == UNDEFINED) + { + val.lattice_val = VARYING; + val.value = NULL_TREE; + val.mask = double_int_minus_one; + return val; + } + gcc_assert ((r1val.lattice_val == CONSTANT && TREE_CODE (r1val.value) == INTEGER_CST) || double_int_minus_one_p (r1val.mask)); |