Integrated: 8373508: C2: sinking CreateEx out of loop breaks the graph

Roland Westrelin roland at openjdk.org
Mon Jan 5 14:06:29 UTC 2026


On Tue, 16 Dec 2025 11:04:52 GMT, Roland Westrelin <roland at openjdk.org> wrote:

> A `CreateEx` gets sunk out of loop by
> `PhaseIdealLoop::try_sink_out_of_loop()` and, as a consequence, the
> following logic:
> 
> 
>   return (in(0)->is_CatchProj() && in(0)->in(0)->is_Catch() &&
>           in(0)->in(0)->in(1) == in(1)) ? this : call->in(TypeFunc::Parms);
> 
> 
> in `CreateExNode::Identity()` triggers which leads to the crash
> because `call->in(TypeFunc::Parms)` is not even an object in this
> particular case.
> 
> It's actually not clear to me what that logic in
> `CreateExNode::Identity()` is expected to do and I wonder if it's
> still needed.
> 
> Anyway, the fix I propose is to skip `CreateEx` in
> `PhaseIdealLoop::try_sink_out_of_loop()`.

This pull request has now been integrated.

Changeset: 6ae3e064
Author:    Roland Westrelin <roland at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/6ae3e064352a56c5be140fba1ad6d040219432b0
Stats:     159 lines in 3 files changed: 159 ins; 0 del; 0 mod

8373508: C2: sinking CreateEx out of loop breaks the graph

Reviewed-by: chagedorn, dlong

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

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


More information about the hotspot-compiler-dev mailing list