This is the mail archive of the
mailing list for the GCC project.
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.