This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
miscompiled loop condition
- To: gcc-bugs at gcc dot gnu dot org
- Subject: miscompiled loop condition
- From: Stephen L Moshier <moshier at mediaone dot net>
- Date: Thu, 25 Nov 1999 13:18:57 -0500 (EST)
- Reply-To: moshier at mediaone dot net
November 25 CVS sources
In this test case the expression in the while condition gets
miscompiled with -O2 on i386 and sparc. The result is that the
program loops endlessly when it is run.
double x, y;
int
main()
{
x = 2.0;
y = x;
do
{
x = y;
y = 2.0 * y;
}
while ( ! ((y - x) >= 20));
}