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*: Andrew Pinski <pinskia at physics dot uc dot edu>*To*: Geoffrey Keating <geoffk at geoffk dot org>*Cc*: gcc-patches at gcc dot gnu dot org, Fariborz Jahanian <fjahanian at apple dot com>*Date*: Tue, 5 Oct 2004 16:02:33 -0400*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>

On Oct 5, 2004, at 3:52 PM, Geoffrey Keating wrote:

Fariborz Jahanian <fjahanian@apple.com> writes:

OK for fsf mainline?

No, not OK.

- thanks, fariborz (fjahanian@apple.com)

ChangeLog:

2004-10-05 Fariborz Jahanian <fjahanian@apple.com>

* tree-ssa-dom.c (associative_fp_binop): New function. (simplify_rhs_and_lookup_avail_expr): Disallow associativity and constant folding of floating point MULT_EXPR/PLUS_EXPR expressions.

+ enum tree_code code = TREE_CODE (exp); + return !(!flag_unsafe_math_optimizations

This flag is not clearly the right one. Why did you pick it from the alternatives?

Why is this not right flag, it is used other places which we do the same thing.

+ && (code == MULT_EXPR || code == PLUS_EXPR) + && FLOAT_TYPE_P (TREE_TYPE (exp)));

This function appears to disallow folding

(x * 2.0) * 2.0

into

x * 4.0

which seems to me to be valid.

Also this is a valid transformation only if the constants will generate a power of 2.

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

**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

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

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