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

C2: when a Type node becomes dead, make CFG path that uses it unreachable

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 25
    • 17, 21, 23, 24, 25
    • hotspot
    • b18

      This is motivated by JDK-8275202. The pass that it adds can eliminate the range check in:

      int[] array = new int[arraySize];
      if (j <= arraySize) {
        if (i >= 0) {
          if (i < j) {
            int v = array[i];

      If during some subsequent IGVN, i constant folds to some value that's positive but out of bounds, the array access won't be reachable anymore but IGVN can't constant fold the condition that leads to the array access. Because the range check was eliminated however, the range check CastII becomes dead which can lead to a broken graph.

      What this proposes is that when the CastII becomes dead, C2 makes the paths that use the dead node dead as well.

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

              Created:
              Updated:
              Resolved: