JDK-8210148 : Minimal VM build has new warnings after JDK-8072498 (Multi-thread JNI weak reference processing)
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2018-08-29
  • Updated: 2018-08-29
  • Resolved: 2018-08-29
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Description
/pool/buildbot/slaves/sobornost/jdkX/build/src/hotspot/share/gc/shared/weakProcessorPhases.cpp: In static member function 'static bool WeakProcessorPhases::is_serial(WeakProcessorPhases::Phase)':
/pool/buildbot/slaves/sobornost/jdkX/build/src/hotspot/share/gc/shared/weakProcessorPhases.cpp:62:46: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
   return (index(phase) - serial_phase_start) < serial_phase_count;
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors

This because serial_phase_count ends up being "0" with Minimal VM, because JVMTI and JFR are disabled:

  enum Phase {
    // Serial phases.
    JVMTI_ONLY(jvmti COMMA)
    JFR_ONLY(jfr COMMA)

    // OopStorage phases.
    jni,
    vm
  };

  static const uint serial_phase_start = 0;
  static const uint serial_phase_count = jni;

This can be worked around with -Wno-type-limits. We probably want to tag the usage in weakProcessorPhases.cpp:62 as safe one, instead of disabling that compiler warning wholesale.
Comments
JDK-8210164 has a webrev attached to the bug so I am keeping that one open.
29-08-2018

Kim, you might want to have a look.
29-08-2018