This reproduces reliably with an internal test:
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (workspace/open/src/hotspot/share/opto/parse1.cpp:180), pid=791450, tid=791463
# assert(_gvn.type(l)->higher_equal(type)) failed: must constrain OSR typestate
#
# JRE version: Java(TM) SE Runtime Environment (20.0+25) (fastdebug build 20-ea+25-1866)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 20-ea+25-1866, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0x175019c] Parse::check_interpreter_type(Node*, Type const*, SafePointNode*&)+0x56c
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
Current CompileTask:
C2: 127 26 % !b 4 XXXX @ 38 (94 bytes)
Stack: [0x00007f1a9b537000,0x00007f1a9b638000], sp=0x00007f1a9b634900, free space=1014k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x175019c] Parse::check_interpreter_type(Node*, Type const*, SafePointNode*&)+0x56c (parse1.cpp:180)
V [libjvm.so+0x1755fc4] Parse::load_interpreter_state(Node*)+0xfa4
V [libjvm.so+0x1760e72] Parse::Parse(JVMState*, ciMethod*, float)+0x5a2
V [libjvm.so+0x90e730] ParseGenerator::generate(JVMState*)+0x110
V [libjvm.so+0xafaf4d] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x168d
V [libjvm.so+0x90c2e7] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x4e7
V [libjvm.so+0xb0865c] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xa7c
V [libjvm.so+0xb09468] CompileBroker::compiler_thread_loop()+0x608
V [libjvm.so+0x107ba06] JavaThread::thread_main_inner()+0x206
V [libjvm.so+0x1a7a9a0] Thread::call_run()+0x100
V [libjvm.so+0x1711c53] thread_native_entry(Thread*)+0x103
(rr) p l->dump(1)
64 ConP === 0 [[ 65 63 84 83 ]] #NULL
99 CheckCastPP === 97 89 [[ 83 ]] #narrowoop: narrowoop: narrowoop: narrowoop: int[int:>=0] (java/lang/Cloneable,java/io/Serializable):exact *[int:>=0] (java/lang/Cloneable,java/io/Serializable):exact *[int:>=0] (java/lang/Cloneable,java/io/Serializable) *[int:>=0] (java/lang/Cloneable,java/io/Serializable) *[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull:exact * !jvms: XXXX @ bci:38 (line 59)
82 Region === 82 97 87 [[ 82 83 18 ]] !jvms: XXXX @ bci:38 (line 59)
83 Phi === 82 99 64 [[ ]] #narrowoop: narrowoop: narrowoop: narrowoop: int[int:>=0] (java/lang/Cloneable,java/io/Serializable):exact *[int:>=0] (java/lang/Cloneable,java/io/Serializable):exact *[int:>=0] (java/lang/Cloneable,java/io/Serializable) *[int:>=0] (java/lang/Cloneable,java/io/Serializable) *[int:>=0] (java/lang/Cloneable,java/io/Serializable):exact * !jvms: XXXX @ bci:38 (line 59)
(rr) p type->dump_on(tty)
narrowoop: narrowoop: narrowoop: narrowoop: int[int:>=0] (java/lang/Cloneable,java/io/Serializable):exact *[int:>=0] (java/lang/Cloneable,java/io/Serializable):exact *[int:>=0] (java/lang/Cloneable,java/io/Serializable):exact *[int:>=0] (java/lang/Cloneable,java/io/Serializable):exact *[int:>=0] (java/lang/Cloneable,java/io/Serializable):exact *$4 = void
(rr) p _gvn.type(l)->dump_on(tty)
narrowoop: narrowoop: narrowoop: narrowoop: int[int:>=0] (java/lang/Cloneable,java/io/Serializable):exact *[int:>=0] (java/lang/Cloneable,java/io/Serializable):exact *[int:>=0] (java/lang/Cloneable,java/io/Serializable) *[int:>=0] (java/lang/Cloneable,java/io/Serializable) *[int:>=0] (java/lang/Cloneable,java/io/Serializable):exact *$6 = void