[Bug middle-end/33181] [4.3 Regression] Revision 127766 generates bad cmov
hjl at lucon dot org
gcc-bugzilla@gcc.gnu.org
Sat Aug 25 23:29:00 GMT 2007
------- Comment #3 from hjl at lucon dot org 2007-08-25 23:29 -------
A smaller testcase:
[hjl@gnu-28 cmov-1]$ cat cmov.cc
extern "C" void abort (void);
enum Status
{
P_ON_LOWER = -4,
P_ON_UPPER = -2,
P_FREE = -1,
};
void
foo (enum Status & stat, double newUpper, double lower, double max)
{
if (stat == P_ON_UPPER)
{
if (newUpper >= max)
stat = (lower <= -max) ? P_FREE : P_ON_LOWER;
else if (newUpper == lower)
stat = P_ON_LOWER;
}
}
int
main ()
{
enum Status stat = P_ON_UPPER;
foo (stat, 5.000000e+01, -1.000000e+100, 1e100);
if (stat != P_ON_UPPER)
abort ();
return 0;
}
[hjl@gnu-28 cmov-1]$ make
/export/gnu/import/rrs/127766/usr/bin/g++ -O2 -g -c -o cmov.o cmov.cc
/export/gnu/import/rrs/127766/usr/bin/g++ -static -o cmov cmov.o
./cmov
make: *** [all] Aborted
[hjl@gnu-28 cmov-1]$
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33181
More information about the Gcc-bugs
mailing list