RFR: 8373508: C2: sinking CreateEx out of loop breaks the graph [v3]

Roland Westrelin roland at openjdk.org
Mon Jan 5 08:45:27 UTC 2026


> 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()`.

Roland Westrelin has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision:

 - Merge branch 'master' into JDK-8373508
 - Update test/hotspot/jtreg/compiler/loopopts/TestCreateExSunkOutOfLoop.java
   
   Co-authored-by: Christian Hagedorn <christian.hagedorn at oracle.com>
 - whitespaces
 - tests
 - more
 - fix

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/28842/files
  - new: https://git.openjdk.org/jdk/pull/28842/files/e4bdff59..968ebef2

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28842&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28842&range=01-02

  Stats: 16526 lines in 2401 files changed: 8803 ins; 2140 del; 5583 mod
  Patch: https://git.openjdk.org/jdk/pull/28842.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28842/head:pull/28842

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


More information about the hotspot-compiler-dev mailing list