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

Minimal VM build has new warnings after JDK-8072498 (Multi-thread JNI weak reference processing)

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Duplicate
    • P4
    • None
    • None
    • hotspot
    • None
    • gc

    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.

      Attachments

        Issue Links

          Activity

            People

              kbarrett Kim Barrett
              shade Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: