From 2671ee45bd0dcbc740cf292f10229be6c35c6e6a Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Fri, 2 Oct 2015 13:31:46 -0600 Subject: [PATCH] Re: [PATCH] Improve DOM's optimization of control statements * tree-ssa-dom.c (optimize_stmt): Note when loop structures need fixups. From-SVN: r228415 --- gcc/ChangeLog | 5 +++++ gcc/tree-ssa-dom.c | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1317a2d6d5e..6a0e10297d1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-10-02 Jeff Law + + * tree-ssa-dom.c (optimize_stmt): Note when loop structures need + fixups. + 2015-10-02 Thomas Schwinge PR target/67822 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); -- 2.30.2