The assert originally fired because we ended up with mismatched array stores on 
the same slice: 

<img width="253" height="277" alt="image" 
src="https://github.com/user-attachments/assets/91651f3c-c37d-4d97-b3ba-da9c20130056";
 />

This is fine if these are flat array stores because they are supposed to be on 
the same `TypeAryPtr::INLINES` slice initially and are only put on separate 
slices later after parsing  (done by 
`Compile::adjust_flat_array_access_aliases()`) to keep dependencies with 
`Object[]` array accesses. This, however, did not correctly work. We could lose 
the flat array information in `Compile::flatten_alias_type()` and end up 
putting two mismatched stores (i.e. `StoreI` and `StoreD`) on the same slice 
that is not `TypeAryPtr::INLINES` as shown by the test case. The assert in 
`StoreNode::Ideal()` then fired when detecting this mismatch.

This was fixed in the meantime by the clean-ups done in 
[JDK-8372113](https://bugs.openjdk.org/browse/JDK-8372113) by putting flat 
array access properly on `TypeAryPtr::INLINES`:
https://github.com/openjdk/valhalla/blob/04365846345b6675964c4b362f6b3531c95c08f3/src/hotspot/share/opto/compile.cpp#L1445-L1448

I've checked with the state before JDK-8372113 with the patch of JDK-8372113 
and it fixes the problem by properly moving the mismatched stores to 
`TypeAryPtr::INLINES` first and then later on separate slices in 
`Compile::adjust_flat_array_access_aliases()`.

I'm therefore proposing to remove the special casing in the assert in 
`StoreNode::Ideal()` again which was inserted to reduce noise in the CI. I also 
re-enabled the disabled testing in `TestLWorld.java` and added the attached 
regression test as additional test.

Thanks,
Christian

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

Commit messages:
 - add test
 - re-enable assert

Changes: https://git.openjdk.org/valhalla/pull/2245/files
  Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=2245&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8343835
  Stats: 48 lines in 2 files changed: 34 ins; 7 del; 7 mod
  Patch: https://git.openjdk.org/valhalla/pull/2245.diff
  Fetch: git fetch https://git.openjdk.org/valhalla.git pull/2245/head:pull/2245

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

Reply via email to