This is the mail archive of the
`gcc-patches@gcc.gnu.org`
mailing list for the GCC project.

Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|

Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |

Other format: | [Raw text] |

*From*: Richard Henderson <rth at redhat dot com>*To*: Gabriel Dos Reis <gdr at cs dot tamu dot edu>*Cc*: Fariborz Jahanian <fjahanian at apple dot com>, Geoff Keating <geoffk at geoffk dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>*Date*: Thu, 7 Oct 2004 14:16:09 -0700*Subject*: Re: Patch gcc-4.0 should not apply mathematical associative rules for addition or multiplication*References*: <2B2F21A1-16FF-11D9-957B-000A95BA54A6@apple.com> <m28yalosbv.fsf@greed.local> <m3sm8sorfl.fsf@merlin.cs.tamu.edu> <B829D438-1710-11D9-BB5A-000A95B1F520@geoffk.org> <C6712220-1712-11D9-A3AB-000A95D7CD40@apple.com> <028CC984-1718-11D9-BB5A-000A95B1F520@geoffk.org> <D02AF864-17BA-11D9-957B-000A95BA54A6@apple.com> <8D0B228A-17F4-11D9-957B-000A95BA54A6@apple.com> <20041007203854.GA10557@redhat.com> <m3fz4quuc6.fsf@merlin.cs.tamu.edu>

On Thu, Oct 07, 2004 at 03:49:45PM -0500, Gabriel Dos Reis wrote: > Richard Henderson <rth@redhat.com> writes: > > | On Wed, Oct 06, 2004 at 05:05:08PM -0700, Fariborz Jahanian wrote: > | > * tree-ssa-dom.c (unsafe_associative_fp_binop): New function. > | > (simplify_rhs_and_lookup_avail_expr): Disallow associativity > | > and constant folding of floating point MULT_EXPR/PLUS_EXPR > | > expressions. > | > | If you apply this, I'll immediately file a PR for a regression > | and assign it to you. > | > | You should allow > | > | X op C1 op C2 > | to combine to > | X op C3 > | > | if C1 op C2 is exactly representable. > > Only if C3 does not overflow, which is the root of the issue why this > transformation is unsafe in general. Well, overflow is a subset of "not exactly representable", yes. But more than that, (X * 0.3 * 3) would not be folded because bits would be lost off the least-significant end. Which is surely the more serious folding error. If we were only concerned about overflow, we should be checking HONOR_INFINITIES instead of flag_unsafe_math_optimizations. r~

**Follow-Ups**:

**References**:**Patch gcc-4.0 should not apply mathematical associative rules for addition or multiplication***From:*Fariborz Jahanian

**Re: Patch gcc-4.0 should not apply mathematical associative rules for addition or multiplication***From:*Geoffrey Keating

**Re: Patch gcc-4.0 should not apply mathematical associative rules for addition or multiplication***From:*Gabriel Dos Reis

**Re: Patch gcc-4.0 should not apply mathematical associative rules for addition or multiplication***From:*Geoff Keating

**Re: Patch gcc-4.0 should not apply mathematical associative rules for addition or multiplication***From:*Dale Johannesen

**Re: Patch gcc-4.0 should not apply mathematical associative rules for addition or multiplication***From:*Geoff Keating

**Re: Patch gcc-4.0 should not apply mathematical associative rules for addition or multiplication***From:*Fariborz Jahanian

**Re: Patch gcc-4.0 should not apply mathematical associative rules for addition or multiplication***From:*Fariborz Jahanian

**Re: Patch gcc-4.0 should not apply mathematical associative rules for addition or multiplication***From:*Richard Henderson

**Re: Patch gcc-4.0 should not apply mathematical associative rules for addition or multiplication***From:*Gabriel Dos Reis

Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|

Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |