RFR: 8356989: Unexpected null in C2 compiled code
Roland Westrelin
roland at openjdk.org
Thu May 22 09:30:33 UTC 2025
In the test case, a non escaping array is initialized by an
`arraycopy` that uses this array as source and destination. Following
the `arraycopy`, one of the element of the array is tested for
`null`. That null check is constant folded to always `null` by escape
analysis. As I understand, the `Allocate` for the array should be
marked by EA as destination of an array copy. That state should then
be propagated by EA to uses and all destinations of an array copy
should be marked as unknown value. But EA has logic that explicitly
skips the case where an `ArrayCopy` has same source and
destination. Removing that logic fixes the failure.
-------------
Commit messages:
- whitespaces
- test
- fix
Changes: https://git.openjdk.org/jdk/pull/25389/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25389&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8356989
Stats: 69 lines in 2 files changed: 61 ins; 4 del; 4 mod
Patch: https://git.openjdk.org/jdk/pull/25389.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/25389/head:pull/25389
PR: https://git.openjdk.org/jdk/pull/25389
More information about the hotspot-compiler-dev
mailing list