diff options
author | Jing Yu <jingyu@google.com> | 2010-01-27 13:22:49 -0800 |
---|---|---|
committer | Jing Yu <jingyu@google.com> | 2010-01-27 13:22:49 -0800 |
commit | 2af1c87cfeb60fe5a05890d13183da7f0c2e8b01 (patch) | |
tree | 1c791a7e0fabfa042f1f748f0ecc5af06784e679 /gcc-4.4.0/gcc | |
parent | 30f553f6a7597e8084704b84876dea2af493d6fe (diff) | |
download | toolchain_gcc-2af1c87cfeb60fe5a05890d13183da7f0c2e8b01.tar.gz toolchain_gcc-2af1c87cfeb60fe5a05890d13183da7f0c2e8b01.tar.bz2 toolchain_gcc-2af1c87cfeb60fe5a05890d13183da7f0c2e8b01.zip |
Backport upstream patch r152443.
Fix a bug in distribute_and_simplify_rtx in which a floating point mode
RTX is unsafely optimized.
Diffstat (limited to 'gcc-4.4.0/gcc')
-rw-r--r-- | gcc-4.4.0/gcc/combine.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc-4.4.0/gcc/combine.c b/gcc-4.4.0/gcc/combine.c index 0de23fe0f..48ec81c44 100644 --- a/gcc-4.4.0/gcc/combine.c +++ b/gcc-4.4.0/gcc/combine.c @@ -8516,6 +8516,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; |