Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8260420

C2 compilation fails with assert(found_sfpt) failed: no node in loop that's not input to safepoint

XMLWordPrintable

    • b08

        class MyClass {
            int x = 42;
        }

        class MainClass {
            static int f1;
            
            static int test(MyClass obj1, MyClass obj2) {
                for (int i = 0; i < 60; ++i) {
                    for (int j = 0; j < 10; ++j) {
                        f1 = obj1.x;
                        obj2.x = 12;
                    }
                }
                return f1;
            }
           
            public static void main(String[] args) {
                MyClass obj = new MyClass() ;
                for (int i = 0; i < 10_000; ++i) {
                    test(obj, obj);
                }
            }
        }

        # A fatal error has been detected by the Java Runtime Environment:
        #
        # Internal Error (/oracle/jdk/open/src/hotspot/share/opto/loopnode.cpp:1782), pid=398590, tid=398612
        # assert(found_sfpt) failed: no node in loop that's not input to safepoint
        #
        # JRE version: Java(TM) SE Runtime Environment (17.0) (fastdebug build 17-internal+0-2020-12-02-1200406.tobias...)
        # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 17-internal+0-2020-12-02-1200406.tobias..., mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
        # Problematic frame:
        # V [libjvm.so+0x130e9de] LoopNode::verify_strip_mined(int) const+0xaee

        Current CompileTask:
        C2: 1211 489 % 4 MainClass::test @ 2 (45 bytes)

        Stack: [0x00007fa5c004a000,0x00007fa5c014b000], sp=0x00007fa5c0145020, free space=1004k
        Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
        V [libjvm.so+0x130e9de] LoopNode::verify_strip_mined(int) const+0xaee
        V [libjvm.so+0x130efbc] CountedLoopNode::skip_strip_mined(int)+0x4c
        V [libjvm.so+0x12ee75b] PhaseIdealLoop::do_peeling(IdealLoopTree*, Node_List&)+0xbb
        V [libjvm.so+0x12f66ff] IdealLoopTree::do_remove_empty_loop(PhaseIdealLoop*) [clone .part.0]+0x6cf
        V [libjvm.so+0x13004a5] IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x125
        V [libjvm.so+0x13003b5] IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&)+0x35
        V [libjvm.so+0x132d313] PhaseIdealLoop::build_and_optimize(LoopOptsMode)+0xc93
        V [libjvm.so+0xa1b38b] PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x32b
        V [libjvm.so+0xa17d5b] Compile::Optimize()+0x14fb
        V [libjvm.so+0xa19b20] Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, DirectiveSet*)+0x1840
        V [libjvm.so+0x849c4c] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x1dc
        V [libjvm.so+0xa29b58] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xe88
        V [libjvm.so+0xa2a7a8] CompileBroker::compiler_thread_loop()+0x5a8
        V [libjvm.so+0x18ad306] JavaThread::thread_main_inner()+0x256
        V [libjvm.so+0x18b3d10] Thread::call_run()+0x100
        V [libjvm.so+0x1596a06] thread_native_entry(Thread*)+0x116

              thartmann Tobias Hartmann
              thartmann Tobias Hartmann
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: