RFR: 8331054: C2 MergeStores: assert failed: unexpected basic type after JDK-8318446 and JDK-8329555

Emanuel Peter epeter at openjdk.org
Wed Apr 24 15:03:52 UTC 2024


I just pushed [JDK-8318446](https://bugs.openjdk.org/browse/JDK-8318446), and @jatin-bhateja just pushed a new test with [JDK-8329555](https://bugs.openjdk.org/browse/JDK-8329555).

Jatin created a test case, where we have an `array pointer`, but its element type is `bottom`, because it merges multiple different arrays. I attached such an example in the regression test:

https://github.com/openjdk/jdk/blob/52877b8d5c0c24c256611ceb9cef1d4fb0c40f68/test/hotspot/jtreg/compiler/c2/TestMergeStores.java#L1275-L1297

The issue is that I assume that array ptr always have a native type. But they can be bottom type, and the BasicType is then T_ILLEGAL, and trying to get the size in bytes leads to the assert.

**Solution:** just check if the BasicTypes are `is_java_primitive(bt)`.

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

Commit messages:
 - 8331054

Changes: https://git.openjdk.org/jdk/pull/18935/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=18935&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8331054
  Stats: 68 lines in 2 files changed: 61 ins; 0 del; 7 mod
  Patch: https://git.openjdk.org/jdk/pull/18935.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/18935/head:pull/18935

PR: https://git.openjdk.org/jdk/pull/18935


More information about the hotspot-compiler-dev mailing list