JDK-8360561 : PhaseIdealLoop::create_new_if_for_predicate hits "must be a uct if pattern" assert
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 26
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-06-25
  • Updated: 2025-09-03
  • Resolved: 2025-08-25
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
26 b13Fixed
Related Reports
Duplicate :  
Relates :  
Description
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (open/src/hotspot/share/opto/loopPredicate.cpp:106), pid=2064286, tid=2064304
#  assert(parse_predicate_success_proj->is_uncommon_trap_if_pattern(reason)) failed: must be a uct if pattern!
#
# JRE version: Java(TM) SE Runtime Environment (26.0+3) (fastdebug build 26-ea+3-153)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 26-ea+3-153, mixed mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x14e3a42]  PhaseIdealLoop::create_new_if_for_predicate(IfTrueNode const*, Node*, Deoptimization::DeoptReason, int, bool)+0x1532

Current CompileTask:
C2:3284  129    b        Test_4344::mainTest (693 bytes)

Stack: [0x0000762e540db000,0x0000762e541db000],  sp=0x0000762e541d5500,  free space=1001k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x14e3a42]  PhaseIdealLoop::create_new_if_for_predicate(IfTrueNode const*, Node*, Deoptimization::DeoptReason, int, bool)+0x1532  (loopPredicate.cpp:106)
V  [libjvm.so+0x14e646f]  PhaseIdealLoop::loop_predication_impl_helper(IdealLoopTree*, IfProjNode*, IfTrueNode*, CountedLoopNode*, ConNode*, Invariance&, Deoptimization::DeoptReason)+0x11f
V  [libjvm.so+0x14eaa37]  PhaseIdealLoop::loop_predication_impl(IdealLoopTree*)+0x11b7
V  [libjvm.so+0x14eb156]  IdealLoopTree::loop_predication(PhaseIdealLoop*)+0xb6
V  [libjvm.so+0x14eb0c8]  IdealLoopTree::loop_predication(PhaseIdealLoop*)+0x28
V  [libjvm.so+0x14eb0c8]  IdealLoopTree::loop_predication(PhaseIdealLoop*)+0x28
V  [libjvm.so+0x14eb0f1]  IdealLoopTree::loop_predication(PhaseIdealLoop*)+0x51
V  [libjvm.so+0x1539a39]  PhaseIdealLoop::build_and_optimize()+0x1319
V  [libjvm.so+0xb48e83]  PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x4f3
V  [libjvm.so+0xb42df0]  Compile::Optimize()+0xb00
V  [libjvm.so+0xb46103]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1f33
V  [libjvm.so+0x96b657]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x467
V  [libjvm.so+0xb55538]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xb58
V  [libjvm.so+0xb56708]  CompileBroker::compiler_thread_loop()+0x578
V  [libjvm.so+0x10a8e0b]  JavaThread::thread_main_inner()+0x13b
V  [libjvm.so+0x1b0ca06]  Thread::call_run()+0xb6
V  [libjvm.so+0x1787f38]  thread_native_entry(Thread*)+0x128

Comments
Changeset: 1f0dfdbc Branch: master Author: Marc Chevalier <mchevalier@openjdk.org> Date: 2025-08-25 06:51:28 +0000 URL: https://git.openjdk.org/jdk/commit/1f0dfdbccac4d23c00cab5663324c965141e1b23
25-08-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/26504 Date: 2025-07-28 12:31:49 +0000
31-07-2025

Attached another reduced test (TestReduced2.java) that does not require PerMethodTrapLimit: $ java -XX:CompileCommand=compileonly,*Test*::* -Xcomp TestReduced2.java Also starts to fail after JDK-8315066.
09-07-2025

ILW = Assert during compilation, with experimental option, no workaround but disable compilation of affected method = HLM = P3
26-06-2025

I attached a simplified version of the test. java -XX:CompileCommand=quiet -XX:CompileCommand=compileonly,*Test*::* -XX:-TieredCompilation -Xbatch -XX:+UnlockExperimentalVMOptions -XX:PerMethodTrapLimit=0 TestReduced.java
26-06-2025

I can reproduce this with: java -XX:CompileCommand=quiet -XX:CompileCommand=compileonly,*Test*::* -XX:-TieredCompilation -Xbatch -XX:+UnlockExperimentalVMOptions -XX:PerMethodTrapLimit=0 Test_4344.java Bisection points to JDK-8315066.
26-06-2025