Patch gcc-4.0 should not apply mathematical associative rules for addition or multiplication
Geoff Keating
geoffk@geoffk.org
Tue Oct 5 20:54:00 GMT 2004
On 05/10/2004, at 1:04 PM, Fariborz Jahanian wrote:
>>> + && (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.
>
> 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2410 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20041005/7b8b4401/attachment.p7s>
More information about the Gcc-patches
mailing list