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

C2 compilation fails with "Bad graph detected in build_loop_late" after JDK-8279888

XMLWordPrintable

    • b06

        Attached Test.java fails after JDK-8279888.

        java -Xbatch -XX:-TieredCompilation Test.java

        Bad graph detected in build_loop_late
        n: 790 AddP === _ 73 791 32 [[ 789 ]] !orig=589 !jvms: Test::test @ bci:76 (line 18)
        early(n): 907 Region === 907 906 1020 [[ 907 292 289 921 924 925 926 930 932 939 948 ]] !orig=[281] !jvms: Test::test @ bci:35 (line 12)
        n->in(1): 73 CheckCastPP === 70 68 [[ 842 105 365 413 152 163 174 589 590 590 781 790 791 791 864 865 865 977 978 978 1251 1252 1252 ]] #float[int:0..max-2] (java/lang/Cloneable,java/io/Serializable):NotNull:exact * !orig=[384] !jvms: Test::test @ bci:3 (line 6)
        early(n->in(1)): 70 Proj === 69 [[ 625 73 626 105 ]] #0 !jvms: Test::test @ bci:3 (line 6)
        n->in(1)->in(1): 68 Proj === 56 [[ 69 73 ]] #5 !jvms: Test::test @ bci:3 (line 6)
        early(n->in(1)->in(1)): 56 AllocateArray === 5 6 7 8 1 (47 25 52 24 55 1 1 1 1 1 1 ) [[ 57 58 59 66 67 68 ]] rawptr:NotNull ( int:>=0, java/lang/Object:NotNull *, bool, int, bool ) Test::test @ bci:3 (line 6) !jvms: Test::test @ bci:3 (line 6)
        n->in(2): 791 AddP === _ 73 73 792 [[ 790 ]] !orig=590 !jvms: Test::test @ bci:76 (line 18)
        early(n->in(2)): 907 Region === 907 906 1020 [[ 907 292 289 921 924 925 926 930 932 939 948 ]] !orig=[281] !jvms: Test::test @ bci:35 (line 12)
        n->in(2)->in(1): 73 CheckCastPP === 70 68 [[ 842 105 365 413 152 163 174 589 590 590 781 790 791 791 864 865 865 977 978 978 1251 1252 1252 ]] #float[int:0..max-2] (java/lang/Cloneable,java/io/Serializable):NotNull:exact * !orig=[384] !jvms: Test::test @ bci:3 (line 6)
        early(n->in(2)->in(1)): 70 Proj === 69 [[ 625 73 626 105 ]] #0 !jvms: Test::test @ bci:3 (line 6)
        n->in(2)->in(2): 73 CheckCastPP === 70 68 [[ 842 105 365 413 152 163 174 589 590 590 781 790 791 791 864 865 865 977 978 978 1251 1252 1252 ]] #float[int:0..max-2] (java/lang/Cloneable,java/io/Serializable):NotNull:exact * !orig=[384] !jvms: Test::test @ bci:3 (line 6)
        early(n->in(2)->in(2)): 70 Proj === 69 [[ 625 73 626 105 ]] #0 !jvms: Test::test @ bci:3 (line 6)
        n->in(2)->in(3): 792 LShiftL === _ 802 30 [[ 791 ]] !orig=588 !jvms: Test::test @ bci:76 (line 18)
        early(n->in(2)->in(3)): 907 Region === 907 906 1020 [[ 907 292 289 921 924 925 926 930 932 939 948 ]] !orig=[281] !jvms: Test::test @ bci:35 (line 12)
        n->in(3): 32 ConL === 0 [[ 589 98 646 374 790 794 856 864 868 969 977 981 1243 1251 1255 ]] #long:16
        early(n->in(3)): 0 Root === 0 156 167 178 615 369 417 616 1232 1113 1129 1222 1168 1184 1199 1209 [[ 0 1 3 20 21 22 25 26 557 30 32 520 45 46 49 53 504 83 84 87 465 137 138 140 151 162 173 207 208 210 212 213 214 216 218 266 270 364 354 757 1069 1070 1078 1085 1332 1333 1346 ]]

        LCA(n): 782 IfTrue === 783 [[ 781 788 789 793 797 801 ]] #1 !orig=[700],[418] !jvms: Test::test @ bci:47 (line 15)
        n->out(0): 789 StoreF === 782 947 790 557 [[ 787 811 824 ]] @float[int:>=0] (java/lang/Cloneable,java/io/Serializable):exact+any *, idx=7; Memory: @float[int:0..max-2] (java/lang/Cloneable,java/io/Serializable):NotNull:exact+any *, idx=7; !orig=591,1305 !jvms: Test::test @ bci:76 (line 18)
        later(n->out(0)): 782 IfTrue === 783 [[ 781 788 789 793 797 801 ]] #1 !orig=[700],[418] !jvms: Test::test @ bci:47 (line 15)
        n->out(0)->out(0): 787 MergeMem === _ 1 7 337 1 120 120 789 793 338 1 1 788 [[ 781 ]] { N337:rawptr:BotPTR - N120:java/lang/Object * N120:java/lang/Object+8 * [narrowklass] N789:float[int:>=0] (java/lang/Cloneable,java/io/Serializable):exact+any * N793:long[int:>=0] (java/lang/Cloneable,java/io/Serializable):exact+any * N338:java/lang/Throwable (java/io/Serializable)+20 * [narrow] - - N788:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):exact+any * } Memory: @BotPTR *+bot, idx=Bot; !orig=594 !jvms: Test::test @ bci:80 (line 9)
        later(n->out(0)->out(0)): 782 IfTrue === 783 [[ 781 788 789 793 797 801 ]] #1 !orig=[700],[418] !jvms: Test::test @ bci:47 (line 15)
        n->out(0)->out(1): 811 Phi === 810 71 789 [[ 1001 ]] #memory Memory: @float[int:>=0] (java/lang/Cloneable,java/io/Serializable):exact+any *, idx=7; !orig=[195],[382] !jvms: Test::test @ bci:22 (line 11)
        later(n->out(0)->out(1)): 810 Loop === 810 179 779 [[ 810 1002 811 812 813 814 815 816 ]]
        n->out(0)->out(2): 824 Phi === 818 789 919 [[ 15 ]] #memory Memory: @float[int:>=0] (java/lang/Cloneable,java/io/Serializable):exact+any *, idx=7;
        later(n->out(0)->out(2)): 818 Region === 818 817 915 [[ 818 615 823 824 825 827 830 ]] !orig=[602] !jvms: Test::test @ bci:19 (line 9)

        idoms of early "907 Region":
        idom[2]: 1003 If
        idom[1]: 1004 IfTrue
        idom[0]: 1005 If
        n: 907 Region

        idoms of (wrong) LCA "782 IfTrue":
        idom[2]: 1003 If
        idom[1]: 269 Region
        idom[0]: 783 RangeCheck
        n: 782 IfTrue

        Real LCA of early "907 Region" (idom[2]) and wrong LCA "782 IfTrue" (idom[2]):
         1003 If === 1002 973 [[ 1004 1016 ]] P=0,999000, C=-1,000000 !orig=204 !jvms: Test::test @ bci:25 (line 11)


        # A fatal error has been detected by the Java Runtime Environment:
        #
        # Internal Error (/workspace/open/src/hotspot/share/opto/loopnode.cpp:6146), pid=3992598, tid=3992612
        # assert(false) failed: Bad graph detected in build_loop_late
        #
        # JRE version: Java(TM) SE Runtime Environment (22.0+23) (fastdebug build 22-ea+23-1832)
        # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 22-ea+23-1832, mixed mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
        # Problematic frame:
        # V [libjvm.so+0x12afcf3] PhaseIdealLoop::build_loop_late_post_work(Node*, bool)+0x8a3

        Current CompileTask:
        C2:2516 412 !b Test::test (84 bytes)

        Stack: [0x00007f41efeff000,0x00007f41f0000000], sp=0x00007f41efffad00, free space=1007k
        Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
        V [libjvm.so+0x12afcf3] PhaseIdealLoop::build_loop_late_post_work(Node*, bool)+0x8a3 (loopnode.cpp:6146)
        V [libjvm.so+0x12afdef] PhaseIdealLoop::build_loop_late(VectorSet&, Node_List&, Node_Stack&)+0xaf
        V [libjvm.so+0x12b06fb] PhaseIdealLoop::build_and_optimize()+0x62b
        V [libjvm.so+0x9feabb] PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x3ab
        V [libjvm.so+0x9f96c6] Compile::Optimize()+0xf36
        V [libjvm.so+0x9fd101] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1b41
        V [libjvm.so+0x849717] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x207
        V [libjvm.so+0xa09270] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x980
        V [libjvm.so+0xa0a008] CompileBroker::compiler_thread_loop()+0x508
        V [libjvm.so+0xec463c] JavaThread::thread_main_inner()+0xcc
        V [libjvm.so+0x17a510a] Thread::call_run()+0xba
        V [libjvm.so+0x14acc4a] thread_native_entry(Thread*)+0x12a

          1. hs_err_pid3992598.log
            80 kB
          2. hs_err_pid4083260.log
            80 kB
          3. replay_pid3992598.log
            229 kB
          4. replay_pid4083260.log
            229 kB
          5. Test.java
            0.7 kB
          6. Test2.java
            0.7 kB

              roland Roland Westrelin
              thartmann Tobias Hartmann
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: