summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-dom.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-02 19:31:46 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-02 19:31:46 +0000
commit535d631e3bf9ade0626655ce99bae85db4d8da72 (patch)
treeb2ab53ebdd480f7c5adc6b55d7018c514f78bd66 /gcc/tree-ssa-dom.c
parentcba229716b3a369e96c71189d98a46ca3ada2717 (diff)
downloadgcc-535d631e3bf9ade0626655ce99bae85db4d8da72.tar.gz
Re: [PATCH] Improve DOM's optimization of control statements
* tree-ssa-dom.c (optimize_stmt): Note when loop structures need fixups. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@228415 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-dom.c')
-rw-r--r--gcc/tree-ssa-dom.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index a8b7038d73b..d9408165157 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -1843,6 +1843,12 @@ optimize_stmt (basic_block bb, gimple_stmt_iterator si,
/* Delete threads that start at BB. */
remove_jump_threads_starting_at (bb);
+ /* If BB is in a loop, then removing an outgoing edge from BB
+ may cause BB to move outside the loop, changes in the
+ loop exit edges, etc. So note that loops need fixing. */
+ if (bb_loop_depth (bb) > 0)
+ loops_state_set (LOOPS_NEED_FIXUP);
+
/* Now clean up the control statement at the end of
BB and remove unexecutable edges. */
remove_ctrl_stmt_and_useless_edges (bb, taken_edge->dest);