aboutsummaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorDoug Kwan <dougkwan@google.com>2009-10-05 09:08:46 +0000
committerDoug Kwan <dougkwan@gcc.gnu.org>2009-10-05 09:08:46 +0000
commit56fe3eff33f4376fb5104d8eaf109618cb07fc9e (patch)
tree4c9459bd6788b618c7453a190aaeecfcf02a4bf2 /gcc/combine.c
parent9cb26fc5c3ed73a784f5030e30ba13f0ad641d8f (diff)
downloadgcc-56fe3eff33f4376fb5104d8eaf109618cb07fc9e.zip
gcc-56fe3eff33f4376fb5104d8eaf109618cb07fc9e.tar.gz
gcc-56fe3eff33f4376fb5104d8eaf109618cb07fc9e.tar.bz2
re PR rtl-optimization/41574 (Distribute floating point expressions causes bad code [4.4 only])
2009-10-05 Doug Kwan <dougkwan@google.com> PR rtl-optimization/41574 Index: combine.c (distribute_and_simplify_rtx): Quit if RTX mode is floating point and we are not doing unsafe math optimizations. From-SVN: r152443
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index 35ab576..64cf992 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -8811,6 +8811,12 @@ distribute_and_simplify_rtx (rtx x, int n)
enum rtx_code outer_code, inner_code;
rtx decomposed, distributed, inner_op0, inner_op1, new_op0, new_op1, tmp;
+ /* Distributivity is not true for floating point as it can change the
+ value. So we don't do it unless -funsafe-math-optimizations. */
+ if (FLOAT_MODE_P (GET_MODE (x))
+ && ! flag_unsafe_math_optimizations)
+ return NULL_RTX;
+
decomposed = XEXP (x, n);
if (!ARITHMETIC_P (decomposed))
return NULL_RTX;