Name: rmT116609 Date: 08/16/2002
FULL PRODUCT VERSION :
java version "1.4.1-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-beta-b14)
Java HotSpot(TM) Client VM (build 1.4.1-beta-b14, mixed mode)
FULL OPERATING SYSTEM VERSION :
Microsoft Windows 2000 [Version 5.00.2195] Service Pack 3
A DESCRIPTION OF THE PROBLEM :
The method which should always return the same value doesn't return the same value. The returned value depends on how many times the method was invoked and on the statements which should not affect the result.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Compile the source code.
2. Run it.
3. You can get an incorrect float value where i >= 1499.
EXPECTED VERSUS ACTUAL BEHAVIOR :
You should always get -2.58, but after 1498 calculations you get incorrect result.
REPRODUCIBILITY :
This bug can be reproduced always.
The problem is not reproducible with -Xint or by using -server flag.
---------- BEGIN SOURCE ----------
public class Bug {
public static void main(String[] args) {
Bug n = new Bug();
for(int i = 0; i < 1600; i++) {
System.out.println(i);
System.out.println(n.get());
}
}
public float get() {
int z0 = (int)Math.sqrt(3.3f);
int z1 = z0 + 1;
int inde3000 = 1+ width1*29 + z0*h1w1;
int inde2910 = width1 + z0;
int inde2901 = width1*29;
float b010=0.76950276f;
float b110=0.06863946f;
float b101=0.025501072f;
float c010=0.017590702f;
float c110=0.8319669f;
float c101=0.5642315f;
float dd010 = -(b010 + c010*z0);
float dd110 = -(b110 + c110*z0);
float dd101 = -(b101 + c101*z1);
float b_ = b110 + b101 + b010;
float c_ = c110 + c101 + c010;
return -(z1 + 0.58f);
}
private int h1w1;
private int width1;
}
---------- END SOURCE ----------
(Review ID: 160846)
======================================================================