JDK-8361702 : C2: assert(is_dominator(compute_early_ctrl(limit, limit_ctrl), pre_end)) failed: node pinned on loop exit test?
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 22
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2025-07-09
  • Updated: 2025-07-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 26
26Unresolved
Related Reports
Relates :  
Description
The attached Java Fuzzer test starts to fail after JDK-8354383:

To reproduce:
$ java -XX:CompileCommand=compileonly,*Test*::* -Xbatch Test.java
$ java -XX:CompileCommand=compileonly,*Reduced*::* -Xbatch Reduced.java

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (c:\sb\prod\1751890963\workspace\open\src\hotspot\share\opto\loopTransform.cpp:2666), pid=54520, tid=32228
#  assert(is_dominator(compute_early_ctrl(limit, limit_ctrl), pre_end)) failed: node pinned on loop exit test?
#
# JRE version: Java(TM) SE Runtime Environment (26.0+6) (fastdebug build 26-ea+6-505)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 26-ea+6-505, mixed mode, sharing, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
# Problematic frame:
# V  [jvm.dll+0xc356b7]  PhaseIdealLoop::do_range_check+0x17b7
.................
Command Line: -Xmx1G -XX:+IgnoreUnrecognizedVMOptions -XX:CompileCommand=quiet -XX:CompileCommand=compileonly,*Test*::* -XX:-TieredCompilation -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:StressSeed=1049931235 -XX:+UnlockDiagnosticVMOptions -XX:+StressLCM -XX:+StressGCM -XX:+StressIGVN -XX:+StressCCP -XX:+StressMacroExpansion -XX:+StressLoopPeeling -XX:+VerifyLoopOptimizations -XX:VerifyIterativeGVN=10 Test_649
................
C2:600   34 % !b        Test_649::mainTest @ 93 (567 bytes)

Stack: [0x0000000541500000,0x0000000541600000],  sp=0x00000005415fb020,  free space=1004k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [jvm.dll+0xc356b7]  PhaseIdealLoop::do_range_check+0x17b7  (loopTransform.cpp:2666)
V  [jvm.dll+0xc3d6a1]  IdealLoopTree::iteration_split_impl+0x4f1  (loopTransform.cpp:3500)
V  [jvm.dll+0xc3d0e8]  IdealLoopTree::iteration_split+0x118  (loopTransform.cpp:3540)
V  [jvm.dll+0xc3d004]  IdealLoopTree::iteration_split+0x34  (loopTransform.cpp:3524)
V  [jvm.dll+0xc3d160]  IdealLoopTree::iteration_split+0x190  (loopTransform.cpp:3552)
V  [jvm.dll+0xc3d160]  IdealLoopTree::iteration_split+0x190  (loopTransform.cpp:3552)
V  [jvm.dll+0xc3d004]  IdealLoopTree::iteration_split+0x34  (loopTransform.cpp:3524)
V  [jvm.dll+0xc4a90e]  PhaseIdealLoop::build_and_optimize+0x103e  (loopnode.cpp:5019)
V  [jvm.dll+0x5c19eb]  Compile::Optimize+0xbbb  (compile.cpp:2503)
V  [jvm.dll+0x5be751]  Compile::Compile+0x10e1  (compile.cpp:860)
V  [jvm.dll+0x4c2469]  C2Compiler::compile_method+0x179  (c2compiler.cpp:144)
V  [jvm.dll+0x5dcc6e]  CompileBroker::invoke_compiler_on_method+0x7ae  (compileBroker.cpp:2327)
V  [jvm.dll+0x5d9fbf]  CompileBroker::compiler_thread_loop+0x32f  (compileBroker.cpp:1972)
V  [jvm.dll+0x92fcd8]  JavaThread::thread_main_inner+0x288  (javaThread.cpp:774)
V  [jvm.dll+0x103d722]  Thread::call_run+0x1b2  (thread.cpp:248)
V  [jvm.dll+0xdefb51]  thread_native_entry+0xe1  (os_windows.cpp:562)
C  [ucrtbase.dll+0x26b4c]  (no source info available)
C  [KERNEL32.DLL+0x14cb0]  (no source info available)
C  [ntdll.dll+0x7edcb]  (no source info available)
Comments
A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/26424 Date: 2025-07-22 08:25:08 +0000
22-07-2025

Thanks for the update! I will tentatively add JDK 22 as affects version which we can further update once we know more.
16-07-2025

Reproducible with attached test case as well: $ java -XX:-TieredCompilation -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:CompileOnly=TestRCEliminationBoundPinnedPreLoopExit::test1 -XX:CompileCommand=quiet -XX:LoopUnrollLimit=100 -XX:-UseLoopPredicate -XX:-UseProfiledLoopPredicate TestRCEliminationBoundPinnedPreLoopExit # # A fatal error has been detected by the Java Runtime Environment: # # Internal Error (/home/roland/jdk-jdk/src/hotspot/share/opto/loopTransform.cpp:2666), pid=3890704, tid=3890723 # assert(is_dominator(compute_early_ctrl(limit, limit_ctrl), pre_end)) failed: node pinned on loop exit test? # That one is reproducible without JDK-8354383 I tried it on 21 as well and the crash doesn't reproduce but that's because it needs an improvement to `MaxI` and `MinI` that was integrated later.
16-07-2025

Since this starts to fail after JDK-8354383, could you have a look [~roland]?
09-07-2025

ILW = Assertion failure in Range Check Elimination, single fuzzer test, disable compilation of affected method or possibly -XX:-RangeCheckElimination = HLM = P3
09-07-2025