The attached fuzzer test fails with the following assertion.
To reproduce:
$ java -Xmx1G -Xcomp -Xbatch -XX:-TieredCompilation -XX:CompileOnly=Test Test.java
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (/home/christian/jdk/open/src/hotspot/share/opto/loopTransform.cpp:1263), pid=23631, tid=23643
# assert(skeleton_predicate_has_opaque(iff)) failed: unexpected
#
# JRE version: Java(TM) SE Runtime Environment (16.0) (slowdebug build 16-internal+0-2020-09-25-1122319.christian...)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (slowdebug 16-internal+0-2020-09-25-1122319.christian..., compiled mode, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0xd143f5] PhaseIdealLoop::copy_skeleton_predicates_to_main_loop_helper(Node*, Node*, Node*, IdealLoopTree*, LoopNode*, unsigned int, unsigned int, unsigned int, Node*, Node*, Node_List const&)+0x3b5
..........
Command Line: -Xmx1G -Xcomp -Xbatch -XX:-TieredCompilation -XX:CompileOnly=Test --add-modules=ALL-DEFAULT jdk.compiler/com.sun.tools.javac.launcher.Main Test.java
..........
Current thread (0x00007fc5bc335fa0): JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=23643, stack(0x00007fc59f1cd000,0x00007fc59f2ce000)]
Current CompileTask:
C2: 9432 90 !b Test::mainTest (512 bytes)
Stack: [0x00007fc59f1cd000,0x00007fc59f2ce000], sp=0x00007fc59f2c7d30, free space=1003k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0xd143f5] PhaseIdealLoop::copy_skeleton_predicates_to_main_loop_helper(Node*, Node*, Node*, IdealLoopTree*, LoopNode*, unsigned int, unsigned int, unsigned int, Node*, Node*, Node_List const&)+0x3b5
V [libjvm.so+0xd15145] PhaseIdealLoop::copy_skeleton_predicates_to_main_loop(CountedLoopNode*, Node*, Node*, IdealLoopTree*, LoopNode*, unsigned int, unsigned int, unsigned int, Node*, Node*, Node_List const&)+0x107
V [libjvm.so+0xd15e3c] PhaseIdealLoop::insert_pre_post_loops(IdealLoopTree*, Node_List&, bool)+0xcb6
V [libjvm.so+0xd1dd6c] IdealLoopTree::iteration_split_impl(PhaseIdealLoop*, Node_List&)+0x388
V [libjvm.so+0xd1e001] IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x10b
V [libjvm.so+0xd1e09f] IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x1a9
V [libjvm.so+0xd1df32] IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x3c
V [libjvm.so+0xd1e09f] IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x1a9
V [libjvm.so+0xd1e09f] IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x1a9
V [libjvm.so+0xd1e09f] IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x1a9
V [libjvm.so+0xd1e09f] IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x1a9
V [libjvm.so+0xd3138e] PhaseIdealLoop::build_and_optimize(LoopOptsMode)+0x1470
V [libjvm.so+0x6f8aa7] PhaseIdealLoop::PhaseIdealLoop(PhaseIterGVN&, LoopOptsMode)+0xb3
V [libjvm.so+0x6f8ba2] PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x46
V [libjvm.so+0x6ec785] Compile::optimize_loops(PhaseIterGVN&, LoopOptsMode)+0xf7
V [libjvm.so+0x6ed533] Compile::Optimize()+0xc0b
V [libjvm.so+0x6e67d8] Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, DirectiveSet*)+0x1090
V [libjvm.so+0x5e12a9] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x15b
V [libjvm.so+0x701859] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x895
V [libjvm.so+0x7004df] CompileBroker::compiler_thread_loop()+0x3df
V [libjvm.so+0x10c508f] compiler_thread_entry(JavaThread*, Thread*)+0x69
V [libjvm.so+0x10c035a] JavaThread::thread_main_inner()+0x14c
V [libjvm.so+0x10c0206] JavaThread::run()+0x118
V [libjvm.so+0x10bc35a] Thread::call_run()+0x180
V [libjvm.so+0xec5db6] thread_native_entry(Thread*)+0x1e4