summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-threadupdate.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-threadupdate.c')
-rw-r--r--gcc/tree-ssa-threadupdate.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c
index 687eee0485a..018092a7a3a 100644
--- a/gcc/tree-ssa-threadupdate.c
+++ b/gcc/tree-ssa-threadupdate.c
@@ -661,6 +661,13 @@ thread_block (basic_block bb, bool noloop_only)
/* We do not update dominance info. */
free_dominance_info (CDI_DOMINATORS);
+ /* We know we only thread through the loop header to loop exits.
+ Let the basic block duplication hook know we are not creating
+ a multiple entry loop. */
+ if (noloop_only
+ && bb == bb->loop_father->header)
+ set_loop_copy (bb->loop_father, loop_outer (bb->loop_father));
+
/* Now create duplicates of BB.
Note that for a block with a high outgoing degree we can waste
@@ -692,6 +699,10 @@ thread_block (basic_block bb, bool noloop_only)
htab_delete (redirection_data);
redirection_data = NULL;
+ if (noloop_only
+ && bb == bb->loop_father->header)
+ set_loop_copy (bb->loop_father, NULL);
+
/* Indicate to our caller whether or not any jumps were threaded. */
return local_info.jumps_threaded;
}