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

Undo workaround for Solaris/SPARC in WorkerDataArray<T>::print_summary_on

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 15
    • Fix Version/s: tbd
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
      gc
    • CPU:
      sparc_64
    • OS:
      solaris

      Description

      For JDK-8208390 a workaround to avoid miscompilation with the current Solaris/SPARC compiler has been added, inlining some MAX2/MIN2 macros in WorkerDataArray<T>::print_summary_on.

      I.e.

            for (uint i = start; i < _length; ++i) {
              T value = get(i);
              if (value != uninitialized()) {
                max = MAX2(max, value);
                min = MIN2(min, value);
                sum = add(sum, value);
                contributing_threads++;
              }
            }

      had to be turned to

            for (uint i = start; i < _length; ++i) {
              T value = get(i);
              if (value != uninitialized()) {
                if (max < value) { max = value; }
                if (min > value) { min = value; }
                sum = add(sum, value);
                contributing_threads++;
              }
            }

      Failing gtest without this change on Solaris/SPARC are the
      UninitializedTicks(pan)ElementWorkerDataArrayTest.print_summary_on_test_test_vm test with the following error without the change:

      ./open/test/hotspot/gtest/gc/shared/test_workerDataArray.cpp:356: Failure
      Expected equality of these values:
         print_expected_summary()
           Which is: "Test array Min: 5.1, Avg: 6.1, Max: 7.2, Diff: 2.1, Workers: 2\n"
         print_summary()
           Which is: "Test array Min: 5.1, Avg: 6.1, Max: 5.1, Diff: 0.0, Workers: 2\n"

      I.e. MAX2 is not correctly evaluated in both debug and product builds.

      Re-evaluate this change if/when the compiler changes.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                tschatzl Thomas Schatzl
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: