Wed, 09 Apr 2008 09:25:45 -0700
6684385: Loop unswitching crashes without LoopNode
Summary: Without LoopNode, exit early from loop unswitching and partial peeling
Reviewed-by: kvn, never, sgoldman
src/share/vm/opto/loopUnswitch.cpp | file | annotate | diff | comparison | revisions | |
src/share/vm/opto/loopopts.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/opto/loopUnswitch.cpp Tue Apr 08 12:23:15 2008 -0400 1.2 +++ b/src/share/vm/opto/loopUnswitch.cpp Wed Apr 09 09:25:45 2008 -0700 1.3 @@ -51,6 +51,9 @@ 1.4 if( !LoopUnswitching ) { 1.5 return false; 1.6 } 1.7 + if (!_head->is_Loop()) { 1.8 + return false; 1.9 + } 1.10 uint nodes_left = MaxNodeLimit - phase->C->unique(); 1.11 if (2 * _body.size() > nodes_left) { 1.12 return false; // Too speculative if running low on nodes.
2.1 --- a/src/share/vm/opto/loopopts.cpp Tue Apr 08 12:23:15 2008 -0400 2.2 +++ b/src/share/vm/opto/loopopts.cpp Wed Apr 09 09:25:45 2008 -0700 2.3 @@ -2257,6 +2257,9 @@ 2.4 // 2.5 bool PhaseIdealLoop::partial_peel( IdealLoopTree *loop, Node_List &old_new ) { 2.6 2.7 + if (!loop->_head->is_Loop()) { 2.8 + return false; } 2.9 + 2.10 LoopNode *head = loop->_head->as_Loop(); 2.11 2.12 if (head->is_partial_peel_loop() || head->partial_peel_has_failed()) {