aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrasbold <none@none>2008-04-09 09:25:45 -0700
committerrasbold <none@none>2008-04-09 09:25:45 -0700
commit56c828b704cf049c95962d39e715c68907f6a305 (patch)
treecf2100a98acc23b63214e292d18aca4334d0ada0
parent99011bbade477f730d28cc9dff63e4b8f514a601 (diff)
6684385: Loop unswitching crashes without LoopNode
Summary: Without LoopNode, exit early from loop unswitching and partial peeling Reviewed-by: kvn, never, sgoldman
-rw-r--r--src/share/vm/opto/loopUnswitch.cpp3
-rw-r--r--src/share/vm/opto/loopopts.cpp3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/share/vm/opto/loopUnswitch.cpp b/src/share/vm/opto/loopUnswitch.cpp
index fcba517e8..5f384b60b 100644
--- a/src/share/vm/opto/loopUnswitch.cpp
+++ b/src/share/vm/opto/loopUnswitch.cpp
@@ -51,6 +51,9 @@ bool IdealLoopTree::policy_unswitching( PhaseIdealLoop *phase ) const {
if( !LoopUnswitching ) {
return false;
}
+ if (!_head->is_Loop()) {
+ return false;
+ }
uint nodes_left = MaxNodeLimit - phase->C->unique();
if (2 * _body.size() > nodes_left) {
return false; // Too speculative if running low on nodes.
diff --git a/src/share/vm/opto/loopopts.cpp b/src/share/vm/opto/loopopts.cpp
index 6535c5529..52dc89266 100644
--- a/src/share/vm/opto/loopopts.cpp
+++ b/src/share/vm/opto/loopopts.cpp
@@ -2257,6 +2257,9 @@ bool PhaseIdealLoop::is_valid_clone_loop_form( IdealLoopTree *loop, Node_List& p
//
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()) {