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

C2: loop unswitching and unsafe accesses cause crash

XMLWordPrintable

    • b21

          static A test_helper(Object o) {
              // this includes a check for null with both branches taken
              return (A)o;
          }


          // Loop is unswitched because of the test null for null from the
          // checkcast above, unsafe access is copied in each branch, the
          // compiler sees a memory access to a null object
          static int test1(Object o, long offset) {
              int f = 0;
              for (int i = 0; i < 100; i++) {
                  A a = test_helper(o);
                  f = UNSAFE.getInt(a, offset);
              }
              return f;
          }

      Results in:

      # Internal Error (/home/roland/hs/hotspot/src/share/vm/opto/compile.cpp:1720), pid=24319, tid=24364
      # assert(flat != TypePtr::BOTTOM) failed: cannot alias-analyze an untyped ptr: adr_type = NULL+12

            roland Roland Westrelin
            roland Roland Westrelin
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: