-
Bug
-
Resolution: Fixed
-
P3
-
8u251, 9, 10, 11, 12, 13, 14, 15, 16
-
b21
-
x86_64
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8256130 | 11.0.11-oracle | Dukebot | P3 | Resolved | Fixed | b01 |
JDK-8256470 | 11.0.10 | Tobias Hartmann | P3 | Resolved | Fixed | b03 |
ADDITIONAL SYSTEM INFORMATION :
OpenJDK 11 and 14 allow to reproduce this bug, GraalVM does not.
A DESCRIPTION OF THE PROBLEM :
The first integer printed is not in the range specified by if-statement.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Just run the main() method and check the output.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
#1 {integer in the range from 1000 to 9999 (both sides including)}
#2 {integer in the range from 1000 to 9999 (both sides including)}
ACTUAL -
#1 {integer NOT in the range from 1000 to 9999 (both sides including)}
#2 {integer in the range from 1000 to 9999 (both sides including)}
---------- BEGIN SOURCE ----------
public class Bug {
/*
* Why does this code output:
* #1 1746077296
* #2 9296
* ???
* */
public static void main(String[] args) {
for (int i = 0, j = 0; j < 2; i -= 1000) {
if ((i > 999) && (i < 10000)) {
j++;
System.out.println("#" + j + ' ' + i + ' ' + Integer.MAX_VALUE);
}
}
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Use -XX:TieredStopAtLevel=3 option or make counter i and j volatile class fields.
FREQUENCY : always
OpenJDK 11 and 14 allow to reproduce this bug, GraalVM does not.
A DESCRIPTION OF THE PROBLEM :
The first integer printed is not in the range specified by if-statement.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Just run the main() method and check the output.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
#1 {integer in the range from 1000 to 9999 (both sides including)}
#2 {integer in the range from 1000 to 9999 (both sides including)}
ACTUAL -
#1 {integer NOT in the range from 1000 to 9999 (both sides including)}
#2 {integer in the range from 1000 to 9999 (both sides including)}
---------- BEGIN SOURCE ----------
public class Bug {
/*
* Why does this code output:
* #1 1746077296
* #2 9296
* ???
* */
public static void main(String[] args) {
for (int i = 0, j = 0; j < 2; i -= 1000) {
if ((i > 999) && (i < 10000)) {
j++;
System.out.println("#" + j + ' ' + i + ' ' + Integer.MAX_VALUE);
}
}
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Use -XX:TieredStopAtLevel=3 option or make counter i and j volatile class fields.
FREQUENCY : always
- backported by
-
JDK-8256130 Partial peeling at unsigned test adds incorrect loop exit check
-
- Resolved
-
-
JDK-8256470 Partial peeling at unsigned test adds incorrect loop exit check
-
- Resolved
-
- relates to
-
JDK-8332920 C2: Partial Peeling is wrongly applied for CmpU with negative limit
-
- Resolved
-