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

[lworld] C2 compilation fails with assert "should be addp but is Phi"

XMLWordPrintable

      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (/oracle/valhalla/open/src/hotspot/share/opto/memnode.cpp:3913), pid=171603, tid=171616
      # assert(base->is_AddP()) failed: should be addp but is Phi

      Current CompileTask:
      C2: 277 25 % 4 MainClass::test @ 10 (88 bytes)

      Stack: [0x00007f6758436000,0x00007f6758537000], sp=0x00007f67585316b0, free space=1005k
      Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0x149f150] InitializeNode::can_capture_store(StoreNode*, PhaseGVN*, bool) [clone .part.0]+0x420
      V [libjvm.so+0x14aa43e] StoreNode::Ideal(PhaseGVN*, bool)+0x5de
      V [libjvm.so+0x167afdd] PhaseIterGVN::transform_old(Node*)+0xed
      V [libjvm.so+0x16734ce] PhaseIterGVN::optimize()+0x7e
      V [libjvm.so+0xa4da4a] PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x6da
      V [libjvm.so+0xa49a8b] Compile::Optimize()+0xb3b
      V [libjvm.so+0xa4c493] Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, DirectiveSet*)+0x1a53
      V [libjvm.so+0x861c98] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x1f8
      V [libjvm.so+0xa5c471] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xea1
      V [libjvm.so+0xa5d0f8] CompileBroker::compiler_thread_loop()+0x5a8
      V [libjvm.so+0x1921ba6] JavaThread::thread_main_inner()+0x256
      V [libjvm.so+0x1928030] Thread::call_run()+0x100
      V [libjvm.so+0x15eaea6] thread_native_entry(Thread*)+0x116


      primitive class MyValue {
          int b = 2;
      }

      class MainClass {

          int iField;
          MyValue c;
          MyValue t;
        
          void test(MyValue[] array) {
              for (int i = 0; i < 10; ++i) {
                  for (int j = 0; j < 10; ++j) {
                      iField = 6;
                  }
                  for (int j = 0; j < 2; ++j) {
                      iField += array[0].b;
                  }
                  MyValue[] array2 = {new MyValue()};
                  c = array[0];
                  array2[0] = t;
              }
          }

          public static void main(String[] args) {
              MainClass q = new MainClass();
              MyValue[] array = {new MyValue()};
              for (int i = 0; i < 50_000; ++i) {
                  q.test(array);
              }
          }
      }

            yyang Yi Yang
            thartmann Tobias Hartmann
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: