[gnu.gcc.bug] "Redundant" test instructions in GCC 1.34 on m68k

gnu@toad.com (03/24/89)

The reason for the "redundant" test is in case the add overflows.
The 68K is "smart" and will still jump "greater than" if the
add overflowed into what appears to be a negative number (because
it notices that the V bit is set).  We have to defeat that so that

	if (a+b < 0)
and
	c = a+b;
	if (c < 0)

work the same, and so you get the same result when optimizing and not.
The compiler attempts to track whether overflow might be set, to avoid
the extra test when possible (e.g. if the last op was "or" rather than
"add").

The SPARC sets condition codes the same way as the 68000, but its machine
description does not properly handle this case.  Try Joe's test program
on the Sparc, setting i to 2147483647 and j to 5.  When unoptimized, it
says the result is negative; when optimized, positive.

	John Gilmore