http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55833
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> 2013-01-10 15:02:37 UTC --- By unswitching on an exit test that exits to the enclosing loop we create an unswitched loop that is now reached by what looks like an exit test of the outer loop which is part of an irreducible region. I'm not sure we can reliably detect all cases we need to manually mark the entry edge for. So ... re-mark_irreducible_loops () after each transform? And cheaper checking by Index: loop-unswitch.c =================================================================== --- loop-unswitch.c (revision 195085) +++ loop-unswitch.c (working copy) @@ -145,12 +145,7 @@ unswitch_loops (void) /* Go through inner loops (only original ones). */ FOR_EACH_LOOP (li, loop, LI_ONLY_INNERMOST) - { - unswitch_single_loop (loop, NULL_RTX, 0); -#ifdef ENABLE_CHECKING - verify_loop_structure (); -#endif - } + unswitch_single_loop (loop, NULL_RTX, 0); iv_analysis_done (); } @@ -370,6 +365,10 @@ unswitch_single_loop (struct loop *loop, nloop = unswitch_loop (loop, bbs[i], copy_rtx_if_shared (cond), cinsn); gcc_assert (nloop); +#ifdef ENABLE_CHECKING + verify_loop_structure (); +#endif + /* Invoke itself on modified loops. */ unswitch_single_loop (nloop, rconds, num + 1); unswitch_single_loop (loop, conds, num + 1);