1.1 --- a/src/share/vm/c1/c1_IR.cpp Fri Nov 07 13:55:14 2008 -0800 1.2 +++ b/src/share/vm/c1/c1_IR.cpp Tue Nov 11 23:03:35 2008 -0800 1.3 @@ -574,12 +574,23 @@ 1.4 TRACE_LINEAR_SCAN(3, tty->print_cr("backward branch")); 1.5 assert(is_visited(cur), "block must be visisted when block is active"); 1.6 assert(parent != NULL, "must have parent"); 1.7 - assert(parent->number_of_sux() == 1, "loop end blocks must have one successor (critical edges are split)"); 1.8 1.9 cur->set(BlockBegin::linear_scan_loop_header_flag); 1.10 cur->set(BlockBegin::backward_branch_target_flag); 1.11 1.12 parent->set(BlockBegin::linear_scan_loop_end_flag); 1.13 + 1.14 + // When a loop header is also the start of an exception handler, then the backward branch is 1.15 + // an exception edge. Because such edges are usually critical edges which cannot be split, the 1.16 + // loop must be excluded here from processing. 1.17 + if (cur->is_set(BlockBegin::exception_entry_flag)) { 1.18 + // Make sure that dominators are correct in this weird situation 1.19 + _iterative_dominators = true; 1.20 + return; 1.21 + } 1.22 + assert(parent->number_of_sux() == 1 && parent->sux_at(0) == cur, 1.23 + "loop end blocks must have one successor (critical edges are split)"); 1.24 + 1.25 _loop_end_blocks.append(parent); 1.26 return; 1.27 }