C2 replaces range checks by unsigned comparison with -1

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 9
    • Affects Version/s: 9
    • Component/s: hotspot
    • None
    • b84

        The range check optimization introduced by JDK-8073480 replaces checks of the form (i < 0 && i > length - 1) with an unsigned comparison of i and (length - 1). If length is 0, i is compared to -1 and the range check does *not* fail.

        Applying the attached patch to TestBadFoldCompare.java reproduces the problem.

              Assignee:
              Roland Westrelin
              Reporter:
              Tobias Hartmann
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: