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
--- 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) {