[lworld] RFR: 8374911: [lworld] C2 fails assert(adr_type != nullptr) failed: source must have adr_type [v2]

Damon Fenacci dfenacci at openjdk.org
Mon Jan 26 07:20:40 UTC 2026


> # Issue
> 
> The Valhalla test `compiler/valhalla/inlinetypes/TestArrayCopy.java#AlwaysIncrementalInline` crashes intermittently in `ProjNode::adr_type()` when asserting `adr_type != nullptr`.
> 
> # Cause
> 
> We are in the process of cleaning up an unreacheable subgraph and we get to a situation like this one:
> 
> <img width="427" height="336" alt="Screenshot 2026-01-20 at 19 57 31" src="https://github.com/user-attachments/assets/c040b647-0858-4cc9-af68-5a1b05cc58fb" />
> 
> We have a Tuple node with top inputs followed by memory projection. Later in the same ideal loop, while running Ideal for the `MemoryMerge` node, we query the type of its memory Proj input, which skips the Tuple here:
> 
> https://github.com/openjdk/valhalla/blob/b2f45e0f857fb32bdc36e7b93346ebc967b74736/src/hotspot/share/opto/multnode.cpp#L151-L154
> 
> and returns its corresponding input (`2`), which is top (and its `adr_type` returns `nullptr`)
> 
> # Fix
> 
> We should probably check for `ctrl` being top (for this situation) additionally to `nullptr`.
> 
> # Testing
> 
> Tier 1-3+
> Failing test before and after.

Damon Fenacci has updated the pull request incrementally with one additional commit since the last revision:

  JDK-8374911: copyright year

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

Changes:
  - all: https://git.openjdk.org/valhalla/pull/1944/files
  - new: https://git.openjdk.org/valhalla/pull/1944/files/258bcbe7..15bb5baa

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

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/valhalla/pull/1944.diff
  Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1944/head:pull/1944

PR: https://git.openjdk.org/valhalla/pull/1944


More information about the valhalla-dev mailing list