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

Aleksey Shipilev shade at openjdk.org
Fri Jan 30 14:37:29 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`
>  - [ ] Linux x86_64 server fastdebug, `all`
>  - [ ] Linux AArch64 server fastdebug, `all`

Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:

  Test is really debug-only, needs a develop option and fails in verification code

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/29504/files
  - new: https://git.openjdk.org/jdk/pull/29504/files/691e5e61..15dc5785

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

  Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 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