Patch gcc-4.0 should not apply mathematical associative rules for addition or multiplication

Fariborz Jahanian fjahanian@apple.com
Tue Oct 5 21:08:00 GMT 2004


On Oct 5, 2004, at 1:53 PM, Geoff Keating wrote:

>>
>> Wording of ANSIC disallows such foldings even if it is safe sometimes.
>
> Could you explain why you think the standard says this?  The quote you 
> gave said "In the following fragment, rearrangements suggested by 
> mathematical rules for real numbers are often not valid" but it did 
> not say that they were *always* not valid.

The section uses such words as 'often restricted', 'generally invalid' 
'cannot generally replace'. So, I posed this as
the question and consensus was that we should place this under 
-funsafe-math-optimizations flag. Almost all
optimization placed under above flag is 'sometimes' valid and yet we 
place them under this flag. I don't
see a difference in this case.



More information about the Gcc-patches mailing list