RFR: 8356989: Unexpected null in C2 compiled code [v2]

Roland Westrelin roland at openjdk.org
Mon May 26 07:21:08 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.

Roland Westrelin has updated the pull request incrementally with two additional commits since the last revision:

 - Update test/hotspot/jtreg/compiler/escapeAnalysis/TestArrayCopySameSrcDstInitializesNonEscapingArray.java
   
   Co-authored-by: Christian Hagedorn <christian.hagedorn at oracle.com>
 - Update test/hotspot/jtreg/compiler/escapeAnalysis/TestArrayCopySameSrcDstInitializesNonEscapingArray.java
   
   Co-authored-by: Christian Hagedorn <christian.hagedorn at oracle.com>

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/25389/files
  - new: https://git.openjdk.org/jdk/pull/25389/files/d9ed1f1e..d8b31737

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=25389&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25389&range=00-01

  Stats: 2 lines in 1 file changed: 0 ins; 1 del; 1 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