diff src/share/vm/opto/loopPredicate.cpp @ 3840:4e761e7e6e12

7070134: Hotspot crashes with sigsegv from PorterStemmer Summary: Do not move data nodes which are attached to a predicate test to a dominating test. Reviewed-by: never
author kvn
date Tue, 26 Jul 2011 19:35:23 -0700
parents bad7ecd0b6ed
children c96c3eb1efae
line wrap: on
line diff
--- a/src/share/vm/opto/loopPredicate.cpp	Thu Jul 21 11:25:07 2011 -0700
+++ b/src/share/vm/opto/loopPredicate.cpp	Tue Jul 26 19:35:23 2011 -0700
@@ -817,6 +817,10 @@
     cl = head->as_CountedLoop();
     // do nothing for iteration-splitted loops
     if (!cl->is_normal_loop()) return false;
+    // Avoid RCE if Counted loop's test is '!='.
+    BoolTest::mask bt = cl->loopexit()->test_trip();
+    if (bt != BoolTest::lt && bt != BoolTest::gt)
+      cl = NULL;
   }
 
   Node* entry = head->in(LoopNode::EntryControl);
@@ -958,7 +962,7 @@
       if (TraceLoopPredicate) tty->print_cr("lower bound check if: %d", lower_bound_iff->_idx);
 
       // Test the upper bound
-      Node* upper_bound_bol = rc_predicate(loop, ctrl, scale, offset, init, limit, stride, rng, true);
+      Node* upper_bound_bol = rc_predicate(loop, lower_bound_proj, scale, offset, init, limit, stride, rng, true);
       IfNode* upper_bound_iff = upper_bound_proj->in(0)->as_If();
       _igvn.hash_delete(upper_bound_iff);
       upper_bound_iff->set_req(1, upper_bound_bol);