Re: [PATCH] Improve DOM's optimization of control statements
authorJeff Law <law@redhat.com>
Fri, 2 Oct 2015 19:31:46 +0000 (13:31 -0600)
committerJeff Law <law@gcc.gnu.org>
Fri, 2 Oct 2015 19:31:46 +0000 (13:31 -0600)
* tree-ssa-dom.c (optimize_stmt): Note when loop structures need
fixups.

From-SVN: r228415

gcc/ChangeLog
gcc/tree-ssa-dom.c

index 1317a2d6d5e76d59c6c9dfc21452df118469574d..6a0e10297d1eae23b1d06bed4b9217793a81743d 100644 (file)
@@ -1,3 +1,8 @@
+2015-10-02  Jeff Law  <law@redhat.com>
+
+       * tree-ssa-dom.c (optimize_stmt): Note when loop structures need
+       fixups.
+
 2015-10-02  Thomas Schwinge  <thomas@codesourcery.com>
 
        PR target/67822
index a8b7038d73bd00aba5d6bf18d252cee53f0c5818..d9408165157a5c35d1d244b51c4576bcc7cf29ff 100644 (file)
@@ -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);