Commit b9334e4c by Richard Biener Committed by Richard Biener

re PR tree-optimization/65774 (FAIL: gcc.dg/builtin-arith-overflow-1.c (internal compiler error))

2015-04-16  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/65774
	* tree-ssa-ccp.c (evaluate_stmt): Constrain types we invoke
	bit-value tracking on.

From-SVN: r222147
parent f8269ad4
2015-04-16 Richard Biener <rguenther@suse.de> 2015-04-16 Richard Biener <rguenther@suse.de>
PR tree-optimization/65774
* tree-ssa-ccp.c (evaluate_stmt): Constrain types we invoke
bit-value tracking on.
2015-04-16 Richard Biener <rguenther@suse.de>
PR tree-optimization/64277 PR tree-optimization/64277
* tree-vrp.c (check_array_ref): Fix anti-range handling, * tree-vrp.c (check_array_ref): Fix anti-range handling,
simplify upper bound handling. simplify upper bound handling.
......
...@@ -1772,35 +1772,28 @@ evaluate_stmt (gimple stmt) ...@@ -1772,35 +1772,28 @@ evaluate_stmt (gimple stmt)
{ {
enum tree_code subcode = gimple_assign_rhs_code (stmt); enum tree_code subcode = gimple_assign_rhs_code (stmt);
tree rhs1 = gimple_assign_rhs1 (stmt); tree rhs1 = gimple_assign_rhs1 (stmt);
switch (get_gimple_rhs_class (subcode)) tree lhs = gimple_assign_lhs (stmt);
{ if ((INTEGRAL_TYPE_P (TREE_TYPE (lhs))
case GIMPLE_SINGLE_RHS: || POINTER_TYPE_P (TREE_TYPE (lhs)))
if (INTEGRAL_TYPE_P (TREE_TYPE (rhs1)) && (INTEGRAL_TYPE_P (TREE_TYPE (rhs1))
|| POINTER_TYPE_P (TREE_TYPE (rhs1))) || POINTER_TYPE_P (TREE_TYPE (rhs1))))
val = get_value_for_expr (rhs1, true); switch (get_gimple_rhs_class (subcode))
break; {
case GIMPLE_SINGLE_RHS:
val = get_value_for_expr (rhs1, true);
break;
case GIMPLE_UNARY_RHS: case GIMPLE_UNARY_RHS:
if ((INTEGRAL_TYPE_P (TREE_TYPE (rhs1)) val = bit_value_unop (subcode, TREE_TYPE (lhs), rhs1);
|| POINTER_TYPE_P (TREE_TYPE (rhs1))) break;
&& (INTEGRAL_TYPE_P (gimple_expr_type (stmt))
|| POINTER_TYPE_P (gimple_expr_type (stmt))))
val = bit_value_unop (subcode, gimple_expr_type (stmt), rhs1);
break;
case GIMPLE_BINARY_RHS: case GIMPLE_BINARY_RHS:
if (INTEGRAL_TYPE_P (TREE_TYPE (rhs1)) val = bit_value_binop (subcode, TREE_TYPE (lhs), rhs1,
|| POINTER_TYPE_P (TREE_TYPE (rhs1))) gimple_assign_rhs2 (stmt));
{ break;
tree lhs = gimple_assign_lhs (stmt);
tree rhs2 = gimple_assign_rhs2 (stmt);
val = bit_value_binop (subcode,
TREE_TYPE (lhs), rhs1, rhs2);
}
break;
default:; default:;
} }
} }
else if (code == GIMPLE_COND) else if (code == GIMPLE_COND)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment