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]

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



On Oct 7, 2004, at 2:33 PM, Ziemowit Laski wrote:

Actually, I overshot a bit. :-( You need to know that 'X op C1' and 'C1 op C2' are exactly representable. Otherwise, you may have

(X op C1) op C2 != X op (C1 op C2)

which is why this folding is unsafe in the general case.

Yes. Take the case that (C1 op C2) is exactly representable *and* X op (C1 op C2)
overflows but (X op C1) op C2 does not overflow.


- fariborz



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]