--- a/src/hotspot/share/opto/loopTransform.cpp Fri Jul 13 11:21:55 2018 +0800
+++ b/src/hotspot/share/opto/loopTransform.cpp Thu Jul 12 16:31:28 2018 +0200
@@ -768,11 +768,12 @@
Node *init_n = cl->init_trip();
Node *limit_n = cl->limit();
int stride_con = cl->stride_con();
+ if (limit_n == NULL) return false; // We will dereference it below.
+
// Non-constant bounds.
// Protect against over-unrolling when init or/and limit are not constant
// (so that trip_count's init value is maxint) but iv range is known.
- if (init_n == NULL || !init_n->is_Con() ||
- limit_n == NULL || !limit_n->is_Con()) {
+ if (init_n == NULL || !init_n->is_Con() || !limit_n->is_Con()) {
Node* phi = cl->phi();
if (phi != NULL) {
assert(phi->is_Phi() && phi->in(0) == _head, "Counted loop should have iv phi.");