--- 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;