Commit 756191b7 by Joseph Myers Committed by Joseph Myers

combine.c (make_compound_operation): Swap operands of commutative operation if…

combine.c (make_compound_operation): Swap operands of commutative operation if necessary before returning.

	* combine.c (make_compound_operation): Swap operands of
	commutative operation if necessary before returning.

From-SVN: r107219
parent 0ed9a3e3
2005-11-19 Joseph S. Myers <joseph@codesourcery.com>
* combine.c (make_compound_operation): Swap operands of
commutative operation if necessary before returning.
2005-11-19 Richard Guenther <rguenther@suse.de>
PR middle-end/23294
......
......@@ -6914,6 +6914,16 @@ make_compound_operation (rtx x, enum rtx_code in_code)
SUBST (XEXP (x, i), new);
}
/* If this is a commutative operation, the changes to the operands
may have made it noncanonical. */
if (COMMUTATIVE_ARITH_P (x)
&& swap_commutative_operands_p (XEXP (x, 0), XEXP (x, 1)))
{
tem = XEXP (x, 0);
SUBST (XEXP (x, 0), XEXP (x, 1));
SUBST (XEXP (x, 1), tem);
}
return x;
}
......
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