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

Incorrect format strings in PhaseIdealLoop::rc_predicate

    Details

      Backports

        Description

        In 8u, PhaseIdealLoop::rc_predicate has blocks like:

             if (TraceLoopPredicate) {
               predString->print(offset->is_Con() ? "+ %d " : "+ offset", con_offset);
             }

        Note the format string has either zero or one format specifiers, yet always has one argument passed into it. This is incorrect and may lead to odd errors.

        The bad code comes from "8173770: Image conversion improvements":
          http://hg.openjdk.java.net/jdk/jdk/rev/e29c1363af9a#l7.42

        Confusingly, this is already fixed as part during the merge here:
          http://hg.openjdk.java.net/jdk/jdk/rev/219c4312853e#l36.41

        ...which fixes 11u, but not 8u! Need to do the same in 8u.

        We have accidentally fixed it in aarch64-port/jdk8u-shenandoah by backporting this cleanup patch:
          https://hg.openjdk.java.net/aarch64-port/jdk8u-shenandoah/hotspot/rev/3f325d1f67d3#l12.1

        This discrepancy was found by scrubbing the difference between aarch64-port and upstream 8u.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  shade Aleksey Shipilev
                  Reporter:
                  shade Aleksey Shipilev
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: