RFR: 8354282: C2: more crashes in compiled code because of dependency on removed range check CastIIs [v8]

Emanuel Peter epeter at openjdk.org
Tue Dec 2 16:52:32 UTC 2025


On Tue, 2 Dec 2025 15:29:42 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> At least we could say that it is allowed to hoist the RangeCheck,  and the CastII could float up to where the RC is hoisted.
>
> Suggestion:
> 
>     // Use case example: Range Check CastII
>     // Floating: The Cast is only dependent on the single range check. If the range check was ever to be hoisted
>     //              is would be safe to let the the Cast float to where the range check is hoisted up to.
>     // Narrowing: The Cast narrows the type to a positive index. If the input to the Cast is narrower, we can safely
>     //            remove the cast because the array access will be safe.

Ok, I now read the PR from the top, and not just recent changes. If one were to start reading from the top, it would be clear without my suggestions here. But I think it could still be good to apply something about letting the Cast float to where we would hoist the RC.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24575#discussion_r2582034834


More information about the hotspot-dev mailing list