JDK-8243977 : Undo workaround for Solaris/SPARC in WorkerDataArray::print_summary_on
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 15
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: solaris
  • CPU: sparc_64
  • Submitted: 2020-04-28
  • Updated: 2023-08-14
  • Resolved: 2023-08-14
Related Reports
Relates :  
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.
Comments
Reclosing as "Won't Fix"
14-08-2023

In JDK-8244224 Solaris has been removed as a supported platform. So the workaround mentioned in the enhancement for another CR that isn't even pushed yet is unnecessary.
18-06-2020