Commit 4bf371ea by Richard Guenther Committed by Richard Biener

re PR middle-end/31530 (Incorrect folding of multiplication and sign change when…

re PR middle-end/31530 (Incorrect folding of multiplication and sign change when followed by an addition)

2007-04-11  Richard Guenther  <rguenther@suse.de>

	PR middle-end/31530
	* simplify-rtx.c (simplify_binary_operation_1): Do not simplify
	a * -b + c as c - a * b if we honor sign dependent rounding.

From-SVN: r123715
parent 266d11d8
2007-04-11 Richard Guenther <rguenther@suse.de>
PR middle-end/31530
* simplify-rtx.c (simplify_binary_operation_1): Do not simplify
a * -b + c as c - a * b if we honor sign dependent rounding.
2007-04-11 Bernd Schmidt <bernd.schmidt@analog.com>
* config/bfin/bfin-protos.h (bfin_expand_movmem): Renamed from
......
......@@ -1688,7 +1688,8 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode,
XEXP (op0, 1)));
/* Canonicalize (plus (mult (neg B) C) A) to (minus A (mult B C)). */
if (GET_CODE (op0) == MULT
if (!HONOR_SIGN_DEPENDENT_ROUNDING (mode)
&& GET_CODE (op0) == MULT
&& GET_CODE (XEXP (op0, 0)) == NEG)
{
rtx in1, in2;
......@@ -1916,7 +1917,8 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode,
return reversed;
/* Canonicalize (minus A (mult (neg B) C)) to (plus (mult B C) A). */
if (GET_CODE (op1) == MULT
if (!HONOR_SIGN_DEPENDENT_ROUNDING (mode)
&& GET_CODE (op1) == MULT
&& GET_CODE (XEXP (op1, 0)) == NEG)
{
rtx in1, in2;
......@@ -1931,7 +1933,8 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode,
/* Canonicalize (minus (neg A) (mult B C)) to
(minus (mult (neg B) C) A). */
if (GET_CODE (op1) == MULT
if (!HONOR_SIGN_DEPENDENT_ROUNDING (mode)
&& GET_CODE (op1) == MULT
&& GET_CODE (op0) == NEG)
{
rtx in1, in2;
......
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