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 7 Oct 2004, at 14.17, Richard Henderson wrote:


On Thu, Oct 07, 2004 at 01:43:41PM -0700, Ziemowit Laski wrote:
You should allow

	X op C1 op C2
to combine to
	X op C3

if C1 op C2 is exactly representable. Which happens very often.

Yes, but don't 'X op C1' and 'X op C3' also need to be exactly representable?

Not so far as I can determine. What specifically leads you to believe this?

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.

Actually, Dale just popped his head in and suggested that the folding
might be OK if C1 == C2. :-)

--Zem


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