# HG changeset patch # User avoitylov # Date 1535661194 14400 # Node ID 3198179d97fa1ba1a2b82c9b49650b444a8cfaa5 # Parent c88019b32bc493457be9e2e2ccc0eed6c1082fcd 8210164: building Minimal VM fails with error: comparison of unsigned expression < 0 is always false [-Werror=type-limits] Summary: Conditionalize compare with serial_phase_count. Reviewed-by: kbarrett, shade diff -r c88019b32bc4 -r 3198179d97fa src/hotspot/share/gc/shared/weakProcessorPhases.cpp --- a/src/hotspot/share/gc/shared/weakProcessorPhases.cpp Thu Aug 30 16:16:19 2018 -0400 +++ b/src/hotspot/share/gc/shared/weakProcessorPhases.cpp Thu Aug 30 16:33:14 2018 -0400 @@ -59,7 +59,14 @@ } bool WeakProcessorPhases::is_serial(Phase phase) { + // serial_phase_count is 0 if JFR and JVMTI are both not built, + // making this check with unsigned lhs redundant +#if INCLUDE_JVMTI || INCLUDE_JFR return (index(phase) - serial_phase_start) < serial_phase_count; +#else + STATIC_ASSERT(serial_phase_count == 0); + return false; +#endif } bool WeakProcessorPhases::is_oop_storage(Phase phase) {