hotspot/src/share/vm/opto/loopnode.cpp
changeset 10263 fa58671dde31
parent 10258 10c77b8c8d3e
child 10544 e323817a5fe0
--- a/hotspot/src/share/vm/opto/loopnode.cpp	Tue Aug 02 18:36:40 2011 +0200
+++ b/hotspot/src/share/vm/opto/loopnode.cpp	Wed Aug 10 14:06:57 2011 -0700
@@ -689,6 +689,7 @@
 Node* PhaseIdealLoop::exact_limit( IdealLoopTree *loop ) {
   assert(loop->_head->is_CountedLoop(), "");
   CountedLoopNode *cl = loop->_head->as_CountedLoop();
+  assert(cl->is_valid_counted_loop(), "");
 
   if (!LoopLimitCheck || ABS(cl->stride_con()) == 1 ||
       cl->limit()->Opcode() == Op_LoopLimit) {
@@ -1608,14 +1609,13 @@
 void PhaseIdealLoop::replace_parallel_iv(IdealLoopTree *loop) {
   assert(loop->_head->is_CountedLoop(), "");
   CountedLoopNode *cl = loop->_head->as_CountedLoop();
+  if (!cl->is_valid_counted_loop())
+    return;         // skip malformed counted loop
   Node *incr = cl->incr();
   if (incr == NULL)
     return;         // Dead loop?
   Node *init = cl->init_trip();
   Node *phi  = cl->phi();
-  // protect against stride not being a constant
-  if (!cl->stride_is_con())
-    return;
   int stride_con = cl->stride_con();
 
   PhaseGVN *gvn = &_igvn;