--- a/src/share/vm/opto/loopUnswitch.cpp Tue Apr 08 12:23:15 2008 -0400
+++ b/src/share/vm/opto/loopUnswitch.cpp Wed Apr 09 09:25:45 2008 -0700
@@ -49,6 +49,9 @@
// (ie. clone loop with an invariant test that does not exit the loop)
bool IdealLoopTree::policy_unswitching( PhaseIdealLoop *phase ) const {
if( !LoopUnswitching ) {
+ return false;
+ }
+ if (!_head->is_Loop()) {
return false;
}
uint nodes_left = MaxNodeLimit - phase->C->unique();
--- a/src/share/vm/opto/loopopts.cpp Tue Apr 08 12:23:15 2008 -0400
+++ b/src/share/vm/opto/loopopts.cpp Wed Apr 09 09:25:45 2008 -0700
@@ -2257,6 +2257,9 @@ bool PhaseIdealLoop::is_valid_clone_loop
//
bool PhaseIdealLoop::partial_peel( IdealLoopTree *loop, Node_List &old_new ) {
+ if (!loop->_head->is_Loop()) {
+ return false; }
+
LoopNode *head = loop->_head->as_Loop();
if (head->is_partial_peel_loop() || head->partial_peel_has_failed()) {