During the work of JDK-8280126, I found this P2.java, which fails with:
java -Xcomp -XX:CompileCommand=compileonly,P2::test -XX:-TieredCompilation -XX:PerMethodTrapLimit=0 P2.java
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (/home/emanuel/Documents/fork2-jdk/open/src/hotspot/share/opto/block.cpp:1382), pid=59759, tid=59772
# assert(is_loop || block->find_node(def) < j) failed: uses must follow definitions
#
# JRE version: Java(TM) SE Runtime Environment (20.0) (slowdebug build 20-internal-2022-10-06-1045569.emanuel...)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (slowdebug 20-internal-2022-10-06-1045569.emanuel..., compiled mode, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0x659166] PhaseCFG::verify() const+0x4c8
Current CompileTask:
C2: 5503 83 b P2::test (27 bytes)
Stack: [0x00007f9fde757000,0x00007f9fde858000], sp=0x00007f9fde853000, free space=1008k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x659166] PhaseCFG::verify() const+0x4c8 (block.cpp:1382)
V [libjvm.so+0x89baf3] Compile::Code_Gen()+0x229 (compile.cpp:2948)
V [libjvm.so+0x89229f] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x159f (compile.cpp:863)
V [libjvm.so+0x780a9b] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x179 (c2compiler.cpp:113)
V [libjvm.so+0x8b0d32] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x916 (compileBroker.cpp:2240)
V [libjvm.so+0x8af99b] CompileBroker::compiler_thread_loop()+0x3ed (compileBroker.cpp:1916)
V [libjvm.so+0x8d00e4] CompilerThread::thread_entry(JavaThread*, JavaThread*)+0x72 (compilerThread.cpp:58)
V [libjvm.so+0xc5e006] JavaThread::thread_main_inner()+0x144 (javaThread.cpp:699)
V [libjvm.so+0xc5debe] JavaThread::run()+0x182 (javaThread.cpp:684)
V [libjvm.so+0x1330627] Thread::call_run()+0x195 (thread.cpp:224)
V [libjvm.so+0x10dde55] thread_native_entry(Thread*)+0x19b (os_linux.cpp:710)