RFR: 8370405: C2: mismatched store from MergeStores wrongly scalarized in allocation elimination [v3]

Emanuel Peter epeter at openjdk.org
Thu Oct 30 09:28:08 UTC 2025


On Thu, 30 Oct 2025 08:51:59 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> Yes, guarding this with `#if INCLUDE_JVMCI` is fine.
>> 
>> More background thanks to @woess:
>> 
>> This is [just how we encode long/double constants in an int array in the debug info](https://github.com/oracle/graal/blob/4cc7e42d1422e8502172d599216d7a0b6d263d52/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/core/gen/DebugInfoBuilder.java#L167). While for the `byte[]` case, we put illegal/marker values in the remaining slots, for the `int[]` case we put a int 0 constant into the second slot, when we store a long constant + illegal pair. In the debug info, this is reversed so that the second slot is actually [the low part](https://github.com/openjdk/jdk/blob/17fd801b24162dfbac6d4e63ef5048a0fb146074/src/hotspot/share/runtime/deoptimization.cpp#L1396), i.e. the long constant, and the first slot would then contain the int 0 constant (as checked by `sv->field_at(i)->is_constant_int()`). The illegal marker (added [here](https://github.com/openjdk/jdk/commit/12f8b52fb8b4741b5a0087223ca11c210a561038#diff-6de46252a64a081f101658db197dbe77ac35313688971c5aa51700aa0772c9e1R113)) coul
 d be used instead to be consistent with what we do in the isVirtualByteArray case but changing that now probably isn’t worth it.
>
> @dougxc Thanks for getting more info! I'll try to guard it with `#if INCLUDE_JVMCI` :)

Ok, it is adjusted :)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27997#discussion_r2477068579


More information about the hotspot-compiler-dev mailing list