diff options
author | Paolo Bonzini <bonzini@gnu.org> | 2009-01-23 15:57:19 +0000 |
---|---|---|
committer | Paolo Bonzini <bonzini@gcc.gnu.org> | 2009-01-23 15:57:19 +0000 |
commit | 9bacafeb4c9efa2344620a8fdb79a2ea5aadfbad (patch) | |
tree | aacb078bea4cd0815736d26fb8837d2a3a40112b /gcc/tree-ssa-ccp.c | |
parent | 63e505333c7eae301e810d9b84d12a2149e81970 (diff) | |
download | gcc-9bacafeb4c9efa2344620a8fdb79a2ea5aadfbad.zip gcc-9bacafeb4c9efa2344620a8fdb79a2ea5aadfbad.tar.gz gcc-9bacafeb4c9efa2344620a8fdb79a2ea5aadfbad.tar.bz2 |
re PR middle-end/38932 (ICE in set_value_range, at tree-vrp.c:398)
2008-01-23 Paolo Bonzini <bonzini@gnu.org>
PR tree-optimization/38932
* fold-const.c (fold_unary_no_overflow): New.
* tree.h (fold_unary_no_overflow): Declare.
* tree-ssa-ccp.c (ccp_fold): Use fold_unary_no_overflow.
* tree-ssa-sccvn.c (visit_reference_op_load,
simplify_unary_expression): Likewise.
testsuite:
2008-01-23 Paolo Bonzini <bonzini@gnu.org>
PR tree-optimization/38932
* gcc.dg/pr38932.c: New.
From-SVN: r143588
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r-- | gcc/tree-ssa-ccp.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index d0fcf39..ef6890c 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -966,7 +966,6 @@ ccp_fold (gimple stmt) so this should almost always return a simplified RHS. */ tree lhs = gimple_assign_lhs (stmt); tree op0 = gimple_assign_rhs1 (stmt); - tree res; /* Simplify the operand down to a constant. */ if (TREE_CODE (op0) == SSA_NAME) @@ -1002,20 +1001,8 @@ ccp_fold (gimple stmt) return op0; } - res = fold_unary (subcode, gimple_expr_type (stmt), op0); - - /* If the operation was a conversion do _not_ mark a - resulting constant with TREE_OVERFLOW if the original - constant was not. These conversions have implementation - defined behavior and retaining the TREE_OVERFLOW flag - here would confuse later passes such as VRP. */ - if (res - && TREE_CODE (res) == INTEGER_CST - && TREE_CODE (op0) == INTEGER_CST - && CONVERT_EXPR_CODE_P (subcode)) - TREE_OVERFLOW (res) = TREE_OVERFLOW (op0); - - return res; + return fold_unary_ignore_overflow (subcode, + gimple_expr_type (stmt), op0); } case GIMPLE_BINARY_RHS: |