C2: assert(false) failed: infinite loop in PhaseIterGVN::optimize with -XX:LoopUnrollLimit=10000

XMLWordPrintable

      The attached Test.java fails with the following assertion.

      To reproduce:
      $ java -Xbatch -XX:CompileCommand=compileonly,Test*::* -XX:LoopUnrollLimit=10000 Test.java

      Test.java contains the same method as found for TestAssertionPredicates::test8305428No2() in

          compiler/predicates/assertion/TestAssertionPredicates.java

      (can also reproduce the same assert when running this test with -XX:LoopUnrollLimit=10000). As a regression test, we could just add -XX:LoopUnrollLimit=10000 in TestAssertionPredicates.java as an additional jtreg @run.


      Output:
      [...]
       5828--> 7061 StoreI === 28437 7063 7152 7062 [[ 7059 7060 ]] @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):BotPTR:exact+any,iid=bot, idx=6; Memory: @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull:exact[90],iid=bot, idx=6; !orig=2905,1859,1624,447,183 !jvms: Test::test @ bci:22 (line 21)
       5829--> 14597 LoadI === 1584 14598 1237 [[ 14596 ]] @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):BotPTR:exact+any,iid=bot, idx=6; #int !orig=6025,1220,583,450,162 !jvms: Test::test @ bci:21 (line 21)
       5830--> 6347 LoadI === 1176 6348 2360 [[ 6346 ]] @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):BotPTR:exact+any,iid=bot, idx=6; #int !orig=4393,2898,1852,1313,450,162 !jvms: Test::test @ bci:21 (line 21)
       5831--> 4311 LoadI === 1206 4312 1918 [[ 4310 ]] @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):BotPTR:exact+any,iid=bot, idx=6; #int !orig=1631,881,583,450,162 !jvms: Test::test @ bci:21 (line 21)
       5832--> 5952 StoreI === 28437 5954 5417 5953 [[ 5950 5951 ]] @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):BotPTR:exact+any,iid=bot, idx=6; Memory: @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull:exact[94],iid=bot, idx=6; !orig=2915,1869,1634,1314,580,447,183 !jvms: Test::test @ bci:22 (line 21)
       5833--> 5953 LoadI === 1176 5954 2360 [[ 5952 ]] @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):BotPTR:exact+any,iid=bot, idx=6; #int !orig=2916,1870,1635,1315,583,450,162 !jvms: Test::test @ bci:21 (line 21)
       5834--> 7178 LoadI === 1206 7179 1918 [[ 7177 ]] @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):BotPTR:exact+any,iid=bot, idx=6; #int !orig=5232,1629,867,450,162 !jvms: Test::test @ bci:21 (line 21)
       5835--> 6497 LoadI === 1206 6498 1918 [[ 6496 ]] @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):BotPTR:exact+any,iid=bot, idx=6; #int !orig=5467,4337,1860,1625,450,162 !jvms: Test::test @ bci:21 (line 21)
       5836--> 14397 StoreI === 13048 14401 19972 14398 [[ 14395 14396 ]] @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):BotPTR:exact+any,iid=bot, idx=6; Memory: @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull:exact[31],iid=bot, idx=6; !orig=5620,4490,771,580,447,183 !jvms: Test::test @ bci:22 (line 21)
       5837--> 7318 LoadI === 1584 7319 1237 [[ 7317 ]] @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):BotPTR:exact+any,iid=bot, idx=6; #int !orig=5372,2262,1844,450,162 !jvms: Test::test @ bci:21 (line 21)
       5838--> 5376 LoadI === 1584 5377 1237 [[ 5375 ]] @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):BotPTR:exact+any,iid=bot, idx=6; #int !orig=2266,1848,867,450,162 !jvms: Test::test @ bci:21 (line 21)
       5839--> 27891 LoadI === 1170 13368 785 [[ 27890 ]] @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):BotPTR:exact+any,iid=bot, idx=6; #int !orig=12407,8603,6656,5624,4494,784,583,450,162 !jvms: Test::test @ bci:21 (line 21)
       5840--> 5372 LoadI === 1584 5373 1237 [[ 5371 ]] @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):BotPTR:exact+any,iid=bot, idx=6; #int !orig=2262,1844,450,162 !jvms: Test::test @ bci:21 (line 21)
       5841--> 5373 StoreI === 28437 5375 4492 5374 [[ 5371 5372 ]] @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):BotPTR:exact+any,iid=bot, idx=6; Memory: @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull:exact[96],iid=bot, idx=6; !orig=2263,1845,580,447,183 !jvms: Test::test @ bci:22 (line 21)
       5842--> 5495 LoadI === 1176 5496 2360 [[ 5494 ]] @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):BotPTR:exact+any,iid=bot, idx=6; #int !orig=4365,2870,1317,867,450,162 !jvms: Test::test @ bci:21 (line 21)
       5843--> 5392 LoadI === 1584 5393 1237 [[ 5391 ]] @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):BotPTR:exact+any,iid=bot, idx=6; #int !orig=2282,1864,1629,867,450,162 !jvms: Test::test @ bci:21 (line 21)
       5844--> 5493 LoadI === 1176 5494 2360 [[ 5492 ]] @aryptr:int[int:>=0] (java/lang/Cloneable,java/io/Serializable):BotPTR:exact+any,iid=bot, idx=6; #int !orig=4363,2868,1315,583,450,162 !jvms: Test::test @ bci:21 (line 21)


      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (/opt/mach5/mesos/work_dir/slaves/da1065b5-7b94-4f0d-85e9-a3a252b9a32e-S34988/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/f3243ba7-b34c-4eb2-9276-e1867faa18c0/runs/041c28e0-2159-4d53-90b3-ac7f539a1569/workspace/open/src/hotspot/share/opto/phaseX.cpp:1001), pid=77493, tid=77513
      # assert(false) failed: infinite loop in PhaseIterGVN::optimize
      #
      # JRE version: Java(TM) SE Runtime Environment (27.0+4) (fastdebug build 27-ea+4-277)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 27-ea+4-277, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
      # Problematic frame:
      # V [libjvm.so+0x188edfb] PhaseIterGVN::dump_infinite_loop_info(Node*, char const*) [clone .part.0]+0x2b
      ............
      Command Line: -Xbatch -XX:CompileCommand=compileonly,Test*::* -XX:LoopUnrollLimit=10000 --add-modules=ALL-DEFAULT jdk.compiler/com.sun.tools.javac.launcher.SourceLauncher Test.java
      ............
      Current CompileTask:
      C2:4176 108 b 4 Test::test (117 bytes)

      Stack: [0x00007f2692e95000,0x00007f2692f95000], sp=0x00007f2692f8fd80, free space=1003k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0x188edfb] PhaseIterGVN::dump_infinite_loop_info(Node*, char const*) [clone .part.0]+0x2b (phaseX.cpp:1001)
      V [libjvm.so+0x18a4372]
      V [libjvm.so+0xbb9422] PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x672 (loopnode.hpp:1344)
      V [libjvm.so+0xbb01e1] Compile::optimize_loops(PhaseIterGVN&, LoopOptsMode)+0xb1 (compile.cpp:2268)
      V [libjvm.so+0xbb310f] Compile::Optimize()+0xcbf (compile.cpp:2517)
      V [libjvm.so+0xbb62b3] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x2023 (compile.cpp:862)
      V [libjvm.so+0x9cd4e8] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x498 (c2compiler.cpp:147)
      V [libjvm.so+0xbc57a0] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x780 (compileBroker.cpp:2345)
      V [libjvm.so+0xbc7000] CompileBroker::compiler_thread_loop()+0x530 (compileBroker.cpp:1989)
      V [libjvm.so+0x112a41b] JavaThread::thread_main_inner()+0x13b (javaThread.cpp:776)
      V [libjvm.so+0x1bb5d76] Thread::call_run()+0xb6 (thread.cpp:242)
      V [libjvm.so+0x180ba18] thread_native_entry(Thread*)+0x118 (os_linux.cpp:860)

            Assignee:
            Saranya Natarajan
            Reporter:
            Christian Hagedorn
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: