diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-04-11 11:13:54 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-04-11 11:13:54 +0000 |
commit | 516aa37deb121650b6787d53cb1831119cff3e60 (patch) | |
tree | e7ddfba612149002d6ac430dad00a6d93b024c88 /gcc/simplify-rtx.c | |
parent | 2b8e874ff4dd8b23f4c16a4b6c8684ec910888ca (diff) | |
download | gcc-516aa37deb121650b6787d53cb1831119cff3e60.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123715 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r-- | gcc/simplify-rtx.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index e4af34d7adf..cb79aa93d70 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -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; |