diff options
Diffstat (limited to 'gcc/tree-ssa-loop-unswitch.c')
-rw-r--r-- | gcc/tree-ssa-loop-unswitch.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/tree-ssa-loop-unswitch.c b/gcc/tree-ssa-loop-unswitch.c index c340bcb..a17c60e 100644 --- a/gcc/tree-ssa-loop-unswitch.c +++ b/gcc/tree-ssa-loop-unswitch.c @@ -429,9 +429,9 @@ tree_unswitch_outer_loop (struct loop *loop) gcc_assert (loop->inner); if (loop->inner->next) return false; - /* Accept loops with single exit only. */ + /* Accept loops with single exit only which is not from inner loop. */ exit = single_exit (loop); - if (!exit) + if (!exit || exit->src->loop_father != loop) return false; /* Check that phi argument of exit edge is not defined inside loop. */ if (!check_exit_phi (loop)) |