Commit 001003c2 by Paolo Bonzini Committed by Paolo Bonzini

re PR tree-optimization/37662 (ice: tree check: expected ssa_name, have…

re PR tree-optimization/37662 (ice: tree check: expected ssa_name, have integer_cst in get_value_range, at tree-vrp.c:612)

2008-09-30  Paolo Bonzini  <bonzini@gnu.org>

	PR tree-optimization/37662
	* tree-ssa-ccp.c (fold_gimple_assign): Invert the operands of a
	commutative binary operation if they are in the wrong order and
	fold_build2 produces non-GIMPLE.

From-SVN: r140809
parent 9e81dbc7
2008-09-30 Paolo Bonzini <bonzini@gnu.org>
PR tree-optimization/37662
* tree-ssa-ccp.c (fold_gimple_assign): Invert the operands of a
commutative binary operation if they are in the wrong order and
fold_build2 produces non-GIMPLE.
2008-09-30 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/37662
......
......@@ -2711,6 +2711,17 @@ fold_gimple_assign (gimple_stmt_iterator *si)
STRIP_USELESS_TYPE_CONVERSION (result);
if (valid_gimple_rhs_p (result))
return result;
/* Fold might have produced non-GIMPLE, so if we trust it blindly
we lose canonicalization opportunities. Do not go again
through fold here though, or the same non-GIMPLE will be
produced. */
if (commutative_tree_code (subcode)
&& tree_swap_operands_p (gimple_assign_rhs1 (stmt),
gimple_assign_rhs2 (stmt), false))
return build2 (subcode, TREE_TYPE (gimple_assign_lhs (stmt)),
gimple_assign_rhs2 (stmt),
gimple_assign_rhs1 (stmt));
}
break;
......
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