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

Instance field load is replaced by wrong data Phi

    XMLWordPrintable

Details

    • b02
    • b137
    • generic
    • generic

    Backports

      Description

        In C2, instance field loads may be replaced by a corresponding, already existing data Phi in LoadNode::identity():
          // Search for an existing data phi which was generated before for the same
          // instance's field to avoid infinite generation of phis in a loop.

        The problem is, that we only check if the Phi is from the same region and corresponds to the same instance field. We don't check if it contains the actual "up to date" value from the last store to the input memory:
          if (phi->is_Phi() && phi != mem &&
              phi->as_Phi()->is_same_inst_field(this_type, this_iid, this_index, this_offset)) {
            return phi;
          }

        This problem was reported by the Apache Lucene because it causes "impossible" assertions in one of their tests:
        https://issues.apache.org/jira/browse/LUCENE-5168

        The problem is still reproducible with JDK 7, 8 and 9.

        Attachments

          Issue Links

            Activity

              People

                thartmann Tobias Hartmann
                kvn Vladimir Kozlov
                Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: