{
tree currval;
+ if (from != to
+ && TREE_CODE (to) == SSA_NAME
+ && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (to))
+ to = from;
+
/* The only thing we allow as value numbers are VN_TOP, ssa_names
and invariants. So assert that here. */
gcc_assert (to != NULL_TREE
simplified. */
static tree
-simplify_binary_expression (tree rhs)
+simplify_binary_expression (tree stmt, tree rhs)
{
tree result = NULL_TREE;
tree op0 = TREE_OPERAND (rhs, 0);
&& op1 == TREE_OPERAND (rhs, 1))
return NULL_TREE;
+ fold_defer_overflow_warnings ();
+
result = fold_binary (TREE_CODE (rhs), TREE_TYPE (rhs), op0, op1);
+ fold_undefer_overflow_warnings (result && valid_gimple_expression_p (result),
+ stmt, 0);
+
/* Make sure result is not a complex expression consisting
of operators of operators (IE (a + b) + (a + c))
Otherwise, we will end up with unbounded expressions if
break;
case tcc_comparison:
case tcc_binary:
- return simplify_binary_expression (rhs);
+ return simplify_binary_expression (stmt, rhs);
break;
default:
break;