-
Type:
Bug
-
Resolution: Fixed
-
Priority:
P3
-
Affects Version/s: 23, 24, 25
-
Component/s: hotspot
| Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
|---|---|---|---|---|---|---|
| JDK-8350168 | 24.0.2 | Tobias Hartmann | P3 | Resolved | Fixed | b01 |
The attached test file TestC2Miscompile.java prints:
$ java TestC2Miscompile.java
true
true
false
false
true
true
false
true
true
true
false
true
false
true
false
true
NullPointerException: Cannot invoke "TestC2Miscompile$Class0.Class0_method1()"
true
false
false
Examination of the code shows that the receiver can never be null here. Goes away with either of -Xint or -XX:TieredStopAtLevel=3, so I think this must be a C2 bug.
Reproduced today with OracleJDK 25+5, but goes back at least half a year.
$ java TestC2Miscompile.java
true
true
false
false
true
true
false
true
true
true
false
true
false
true
false
true
NullPointerException: Cannot invoke "TestC2Miscompile$Class0.Class0_method1()"
true
false
false
Examination of the code shows that the receiver can never be null here. Goes away with either of -Xint or -XX:TieredStopAtLevel=3, so I think this must be a C2 bug.
Reproduced today with OracleJDK 25+5, but goes back at least half a year.
- backported by
-
JDK-8350168 Unexpected NullPointerException in C2 compiled code due to ReduceAllocationMerges
-
- Resolved
-
- duplicates
-
JDK-8354688 NPE in null-free code
-
- Closed
-
- relates to
-
JDK-8316991 Reduce nullable allocation merges
-
- Resolved
-
- links to
-
Commit(master)
openjdk/jdk24u/d8feb0f3
-
Commit(master)
openjdk/jdk/9f4d3de4
-
Review(master)
openjdk/jdk24u/65
-
Review(master)
openjdk/jdk/23312
(2 links to)