On Thu, 2 Jul 2026 09:20:52 GMT, Christian Hagedorn <[email protected]> wrote:
> The provided test fails with an assertion in `Parse::array_store()` due to > checking an old outdated type and the assert being off. > > We improve the array type in `inline_array_null_guard()` here because we are > storing `null`: > https://github.com/openjdk/valhalla/blob/6adeca933a1361c6f44f51c9c266bd1a20a42380/src/hotspot/share/opto/graphKit.cpp#L4041-L4045 > > We return the casted array but do not update `array_type` in the caller (i.e. > in `Parse::array_store()`). We then continue and hit this assert which also > seems wrong: > https://github.com/openjdk/valhalla/blob/6adeca933a1361c6f44f51c9c266bd1a20a42380/src/hotspot/share/opto/parse2.cpp#L263 > > What we actually want to check is that we either have a known non-flat array, > in which case the `BoolNode` for the just emitted `flat_array_test()` folded > to a constant, which we can also check over the current array type, or that > we find a proper flat array check with a `FlatArrayCheckNode`. > > I also squeezed in three unrelated comment updates in `graphKit.cpp` and > `type.cpp` provided by @marc-chevalier since it's not worth to file an extra > issue just for that. > > Thanks, > Christian > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai). This pull request has now been integrated. Changeset: f32cd1a9 Author: Christian Hagedorn <[email protected]> URL: https://git.openjdk.org/valhalla/commit/f32cd1a958203f27548e3733ddd5aed510d699c1 Stats: 64 lines in 4 files changed: 57 ins; 4 del; 3 mod 8387612: [lworld] C2: assert(array_type->is_flat() || ideal.ctrl()->in(0)->as_If()->is_flat_array_check(&_gvn)) failed: Should be found Co-authored-by: Marc Chevalier <[email protected]> Reviewed-by: thartmann ------------- PR: https://git.openjdk.org/valhalla/pull/2614
