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

C2: assert(!failure) failed: Missed optimization opportunity in PhaseIterGVN with RShiftI and AndI

XMLWordPrintable

      The attached Java Fuzzer test fails with a missed IGVN optimization opportunity (please update the affected versions once the root cause is known):

      To reproduce:
      $ java -XX:CompileCommand=compileonly,*Test*::* -Xcomp -XX:VerifyIterativeGVN=1110 Test.java
      $ java -XX:CompileCommand=compileonly,*Reduced*::* -Xcomp -XX:VerifyIterativeGVN=1110 Reduced.java


      Missed Ideal optimization (can_reshape=false):
      The node was replaced by Ideal.
      Old node:
      dist dump
      ---------------------------------------------
         1 43 ConI === 0 [[ 336 113 113 102 108 97 102 75 80 80 86 91 91 383 ]] #int:1
         1 337 AndI === _ 338 22 [[ 336 ]] !orig=[285],[229] !jvms: Test::test @ bci:43 (line 17)
         0 336 RShiftI === _ 337 43 [[ 343 ]] !orig=[284],[230] !jvms: Test::test @ bci:47 (line 18)
      The result after Ideal:
      dist dump
      ---------------------------------------------
         1 384 ConI === 0 [[ 385 ]] #int:-9
         1 383 RShiftI === _ 338 43 [[ 385 ]]
         0 385 AndI === _ 383 384 [[ ]]


      Missed Ideal optimization (can_reshape=true):
      The node was replaced by Ideal.
      Old node:
      dist dump
      ---------------------------------------------
         1 43 ConI === 0 [[ 336 113 113 102 108 97 102 75 80 80 86 91 91 383 ]] #int:1
         1 337 AndI === _ 338 22 [[ 336 ]] !orig=[285],[229] !jvms: Test::test @ bci:43 (line 17)
         0 336 RShiftI === _ 337 43 [[ 343 ]] !orig=[284],[230] !jvms: Test::test @ bci:47 (line 18)
      The result after Ideal:
      dist dump
      ---------------------------------------------
         1 384 ConI === 0 [[ 385 387 ]] #int:-9
         1 383 RShiftI === _ 338 43 [[ 385 387 ]] !orig=[386]
         0 387 AndI === _ 383 384 [[ ]]

      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (/opt/mach5/mesos/work_dir/slaves/08c2661b-13a6-4cd6-b5ac-ec0dc0a660b1-S15985/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/6f359eff-4690-4467-8d41-a53872b18d35/runs/e03189c9-7042-44f3-87c8-65626beff05b/workspace/open/src/hotspot/share/opto/phaseX.cpp:1105), pid=93252, tid=93270
      # assert(!failure) failed: Missed optimization opportunity in PhaseIterGVN
      ..............
      Command Line: -Xmx1G -XX:+IgnoreUnrecognizedVMOptions -XX:CompileCommand=quiet -XX:CompileCommand=compileonly,*Test*::* -XX:-TieredCompilation -XX:+UnlockDiagnosticVMOptions -XX:StressSeed=829802955 -Xcomp -XX:+VerifyLoopOptimizations -XX:VerifyIterativeGVN=1110 -XX:MaxRAMPercentage=4.16667 -Dtest.boot.jdk=c:\ade\mesos\work_dir\jib-master\install\jdk\24\36\bundles\windows-x64\jdk-24_windows-x64_bin.zip\jdk-24 -Djava.io.tmpdir=c:\sb\prod\1749828829\testoutput\test-support\jtreg_closed_test_hotspot_jtreg_applications_javafuzzer_MediumTest_java\tmp -XX:+CreateCoredumpOnCrash Test
      ..............
      C2:696 9 b Test::lMeth (255 bytes)

      Stack: [0x000000fc13700000,0x000000fc13800000], sp=0x000000fc137fb4f0, free space=1005k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [jvm.dll+0xe3396c] PhaseIterGVN::verify_optimize+0x65c (phaseX.cpp:1105)
      V [jvm.dll+0xe2dbf6] PhaseIterGVN::optimize+0x446 (phaseX.cpp:1070)
      V [jvm.dll+0x5c83fa] Compile::process_for_post_loop_opts_igvn+0x12a (compile.cpp:1893)
      V [jvm.dll+0x5b8909] Compile::Optimize+0xcf9 (compile.cpp:2521)
      V [jvm.dll+0x5b553a] Compile::Compile+0x10fa (compile.cpp:869)
      V [jvm.dll+0x4b9819] C2Compiler::compile_method+0x179 (c2compiler.cpp:144)
      V [jvm.dll+0x5d39ae] CompileBroker::invoke_compiler_on_method+0x7ae (compileBroker.cpp:2323)
      V [jvm.dll+0x5d0cff] CompileBroker::compiler_thread_loop+0x32f (compileBroker.cpp:1968)
      V [jvm.dll+0x925268] JavaThread::thread_main_inner+0x288 (javaThread.cpp:774)
      V [jvm.dll+0x1031532] Thread::call_run+0x1b2 (thread.cpp:248)
      V [jvm.dll+0xde34f1] thread_native_entry+0xe1 (os_windows.cpp:562)
      C [ucrtbase.dll+0x2268a] (no source info available)
      C [KERNEL32.DLL+0x17ac4] (no source info available)
      C [ntdll.dll+0x5a8c1] (no source info available)

        1. FuzzerUtils.java
          13 kB
        2. Reduced.java
          0.4 kB
        3. Test.java
          6 kB

            Unassigned Unassigned
            chagedorn Christian Hagedorn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: