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

C2: CountedLoopEndNodes and Zero Trip Guards are wrongly treated as Runtime Predicate



    • b25


      The assert introduced by JDK-8316105 triggers with the attached test:

      java -Xmx1G -XX:+IgnoreUnrecognizedVMOptions -XX:CompileCommand=quiet -XX:CompileCommand=compileonly,*Test*::* -XX:-TieredCompilation -Xbatch -XX:MaxRAMPercentage=4.16667 Test.java

      # A fatal error has been detected by the Java Runtime Environment:
      # Internal Error (/workspace/open/src/hotspot/share/opto/predicates.cpp:120), pid=27455, tid=41475
      # assert(next->is_IfProj() || opcode == Op_If || opcode == Op_RangeCheck) failed: Regular Predicates consist of an IfProj and an If or RangeCheck node
      # JRE version: Java(TM) SE Runtime Environment (22.0+19) (fastdebug build 22-ea+19-1440)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 22-ea+19-1440, mixed mode, sharing, compressed oops, compressed class ptrs, g1 gc, bsd-amd64)
      # No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

      Current CompileTask:
      C2: 790 62 % b Test::mainTest @ 119 (677 bytes)

      Stack: [0x0000700006808000,0x0000700006908000], sp=0x0000700006903ce0, free space=1007k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.dylib+0x1219b14] VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x5a4 (predicates.cpp:120)
      V [libjvm.dylib+0x121a2a8] VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, __va_list_tag*)+0x38
      V [libjvm.dylib+0x657404] report_vm_error(char const*, int, char const*, char const*, ...)+0xb4
      V [libjvm.dylib+0xf59469] PredicateBlock::verify_block()+0x99
      V [libjvm.dylib+0xd4159c] PhaseIdealLoop::mark_useful_parse_predicates_for_loop(IdealLoopTree*)+0x7c
      V [libjvm.dylib+0xd41120] PhaseIdealLoop::eliminate_useless_parse_predicates()+0x80
      V [libjvm.dylib+0xd4355c] PhaseIdealLoop::build_and_optimize()+0x81c
      V [libjvm.dylib+0x5bcd38] PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x58
      V [libjvm.dylib+0x5bd1cd] Compile::optimize_loops(PhaseIterGVN&, LoopOptsMode)+0x6d
      V [libjvm.dylib+0x5b6897] Compile::Optimize()+0xb27
      V [libjvm.dylib+0x5b4543] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1593
      V [libjvm.dylib+0x4787d6] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x1a6
      V [libjvm.dylib+0x5d358f] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xa9f
      V [libjvm.dylib+0x5d26e7] CompileBroker::compiler_thread_loop()+0x357
      V [libjvm.dylib+0x9a93b5] JavaThread::thread_main_inner()+0x1a5
      V [libjvm.dylib+0x116112c] Thread::call_run()+0xbc
      V [libjvm.dylib+0xeeacf2] thread_native_entry(Thread*)+0x122
      C [libsystem_pthread.dylib+0x68fc] _pthread_start+0xe0
      C [libsystem_pthread.dylib+0x2443] thread_start+0xf
      Lock stack of current Java thread (top to bottom):


        1. FuzzerUtils.java
          13 kB
        2. Test.java
          10 kB
        3. TestReduced.java
          1.0 kB

        Issue Links



              chagedorn Christian Hagedorn
              thartmann Tobias Hartmann
              0 Vote for this issue
              4 Start watching this issue