benchmarking Poly/ML & floating point

Stephen Weeks sweeks@intertrust.com
Mon, 11 Sep 2000 16:24:46 -0700 (PDT)


> It might reverse them any way, even if not inlined.

I think we are not communicating well here.  I am worried that if I define

inline Int Real_equal(Double x1, Double x2) {
	return x1 == x2;
}

and have a call

	if (Real_equal(a, b))
		xxx;
	else
		yyy;

then gcc may inline Real_equal and turn this into 

	if (a != b)
		yyy;
	else
		xxx;

which is wrong.

If I define Real_equal as not inlined, then I can see how gcc might produce

	if (!Real_equal(a, b))
		yyy;
	else
		xxx;

But this is correct.  In other words, I see how gcc could screw me if I allow
Real_equal to be inlined.  I do not see how gcc could screw me if I do not.