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

Emanuel Peter epeter at openjdk.org
Wed Oct 29 15:06:46 UTC 2025


On Wed, 29 Oct 2025 15:00:54 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> @eme64 But `aastore` does a check cast before the store. Since `Object` is not a subtype of `Object(Enumeration)`, should we do a check cast and the value to store is a `CheckCastPP` with the appropriate type?
>
> I'm not following. Can you spell it out with a bit more detail? I'm not very familiar with how we deal with oops and interfaces in general, so I still need to read up a bit more now.
> 
> Just to make clear: we are not talking about a regular store here, but rather capturing the value that would be stored, and instead pass it to the deopt SafePoint. But you probably are aware of that ;)

@rwestrel Do you have an idea how to strip away the interface information? Or would you follow another idea?

I can also take the simple route here, and for now only assert for primitive types. Because the bug comes from MergeStores, and that only works for primitive types. And then I can file a follow-up RFE for someone to strengthen the assert, and possibly fix up other things.

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

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


More information about the hotspot-compiler-dev mailing list