C2: Wrong type of return value of Unsafe.getAndSetObject() call

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P2
    • 11
    • Affects Version/s: 8u161, 9, 10, 11
    • Component/s: hotspot

      Sometimes C2 eliminates non-null branch in the following code as if it proved that ThreadCont.getAndSet() can't return non-null:

          val cont = ThreadCont.getAndSet(threads[i], null)
          if (cont != null) { /* do something */ }

      Detailed problem description & reproducer (by Roman Elizarov):
        https://github.com/ktorio/ktor/blob/resumeAnyThread_HotSpotBug/BUG_README_FIRST.md

            Assignee:
            Vladimir Ivanov
            Reporter:
            Vladimir Ivanov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: