RFR: 8336906: C2: assert(bb->is_reachable()) failed: getting result from unreachable basicblock [v3]

Emanuel Peter epeter at openjdk.org
Tue May 13 12:06:53 UTC 2025


On Tue, 13 May 2025 11:51:59 GMT, Manuel Hässig <mhaessig at openjdk.org> wrote:

>> src/hotspot/share/runtime/deoptimization.cpp line 845:
>> 
>>> 843: 
>>> 844: #ifndef PRODUCT
>>> 845: // Return true if the execution after the provided bytecode continues at the
>> 
>> Suggestion:
>> 
>> // Return true if the execution after the provided bytecode can continue at the
>> 
>> Nit: Because a `cmp_if` may or may not continue with the next bci.
>
> I looked into that and both basic blocks following the `if_cmp` will always be reachable as far as `bb->is_reachable()` is concerned. The bytecode verification code of the `if_cmp` to check that the stack depth on both the then and else branch are the same requires both basic blocks to be reachable.

Ah, I think there is a misunderstanding:
I am saying that `if_cmp` does not always continue. Your statement seems to suggest that all the ones you return `true` for "continue at the next bytecode". That is missing some nuance. They `can` continue to there, but they do not always. I'm just asking for the wording to be more precise.

You may even want to change the name of the whole function. `falls_through` suggests that they would always fall through. But you are rather asking for "does not continue at next bci", `has_no_fallthrough` or similar.

I leave it up to you if / what you want to do here :)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25118#discussion_r2086657500


More information about the hotspot-dev mailing list