RFR: 8375694: C2: Dead loop constructed with CastPP in late inlining

Aleksey Shipilev shade at openjdk.org
Fri Jan 30 12:28:25 UTC 2026


Deeper CTW testing ([JDK-8360557](https://bugs.openjdk.org/browse/JDK-8360557)) often catches fire in the same place. @rwestrel was able to come up with the local reproducer and the prospective fix. This looks like a remaining compiler problem that blocks enabling wider CTW testing, so I took the patch for polishing and more testing.

To quote Roland: "Late inlining is happening in a dead part of the graph. Finding dead subgraphs is expensive so there are some heuristics to avoid the work when possible. I think they need to be tweaked. Right now it's assumed safe when a Phi references the result of a Call. But with late inlining the call can go away and we can't tell what it's hiding. "

So the fix is to exempt these cases from dead loop checks.

Additional testing:
 - [x] Linux x86_64 server fastdebug, new test fails without the fix, passes with it
 - [x] Linux x86_64 server fastdebug, `hotspot_compiler`
 - [x] Linux x86_64 server fastdebug, `applications/ctw/modules`

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

Commit messages:
 - Fix

Changes: https://git.openjdk.org/jdk/pull/29504/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=29504&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8375694
  Stats: 84 lines in 4 files changed: 83 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/29504.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/29504/head:pull/29504

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


More information about the hotspot-compiler-dev mailing list