hotspot/src/share/vm/opto/loopnode.cpp
changeset 29087 79c30f6c2125
parent 28202 3518158ff5d0
child 30593 69f942690128
--- a/hotspot/src/share/vm/opto/loopnode.cpp	Mon Feb 16 08:47:39 2015 -0800
+++ b/hotspot/src/share/vm/opto/loopnode.cpp	Tue Feb 17 11:00:18 2015 -0800
@@ -436,6 +436,19 @@
       return false; // cyclic loop or this loop trips only once
   }
 
+  if (phi_incr != NULL) {
+    // check if there is a possiblity of IV overflowing after the first increment
+    if (stride_con > 0) {
+      if (init_t->_hi > max_jint - stride_con) {
+        return false;
+      }
+    } else {
+      if (init_t->_lo < min_jint - stride_con) {
+        return false;
+      }
+    }
+  }
+
   // =================================================
   // ---- SUCCESS!   Found A Trip-Counted Loop!  -----
   //