summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-threadupdate.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-04-11 08:12:33 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-04-11 08:12:33 +0000
commitd906930c6fa60fb83b74a95d9cc30ff6aa089ab1 (patch)
treeaf40e041d52aa7d52fea8c63f02402da2b3098ef /gcc/tree-ssa-threadupdate.c
parent5126701d2d8f5d123867da7395956842631e99ce (diff)
downloadgcc-d906930c6fa60fb83b74a95d9cc30ff6aa089ab1.tar.gz
2012-04-11 Richard Guenther <rguenther@suse.de>
PR tree-optimization/52912 * tree-ssa-threadupdate.c (thread_block): Tell the cfg manipulation code we are threading through a loop header to an exit destination. * gcc.dg/torture/pr52912.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186303 138bc75d-0d04-0410-961f-82ee72b054a4
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;
}