diff options
| author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-11-25 18:24:57 +0000 |
|---|---|---|
| committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-11-25 18:24:57 +0000 |
| commit | 396c773e8fb91ee9692741dd219df85e10e1b95f (patch) | |
| tree | d3d0304d1b85dd1a1617c991fefb0a307f3f5599 | |
| parent | 334819e8ab3beb4fea8530896fa73ad8d8a9c472 (diff) | |
| download | ppe42-gcc-396c773e8fb91ee9692741dd219df85e10e1b95f.tar.gz ppe42-gcc-396c773e8fb91ee9692741dd219df85e10e1b95f.zip | |
* tree-ssa-threadupdate.c (thread_through_all_blocks): Selectively
invalidate loop information.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205361 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/tree-ssa-threadupdate.c | 38 |
2 files changed, 14 insertions, 29 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8f235decc81..28b415bd44e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2013-11-25 Jeff Law <law@redhat.com> + + * tree-ssa-threadupdate.c (thread_through_all_blocks): Selectively + invalidate loop information. + 2013-11-25 Oleg Endo <olegendo@gcc.gnu.org> * config/sh/sh.md (doloop_end_split): Add missing SI mode. diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c index ee0c838126e..1a52e4702fa 100644 --- a/gcc/tree-ssa-threadupdate.c +++ b/gcc/tree-ssa-threadupdate.c @@ -1579,7 +1579,6 @@ thread_through_all_blocks (bool may_peel_loop_headers) bitmap_iterator bi; bitmap threaded_blocks; struct loop *loop; - bool totally_clobbered_loops = false; /* We must know about loops in order to preserve them. */ gcc_assert (current_loops != NULL); @@ -1675,9 +1674,15 @@ thread_through_all_blocks (bool may_peel_loop_headers) /* Our path is still valid, thread it. */ if (e->aux) { - totally_clobbered_loops - |= thread_block ((*path)[0]->e->dest, false); + struct loop *loop = (*path)[0]->e->dest->loop_father; + + retval |= thread_block ((*path)[0]->e->dest, false); e->aux = NULL; + + /* This jump thread likely totally scrambled this loop. + So arrange for it to be fixed up. */ + loop->header = NULL; + loop->latch = NULL; } } else @@ -1700,32 +1705,7 @@ thread_through_all_blocks (bool may_peel_loop_headers) threaded_blocks = NULL; paths.release (); - /* If we made changes to the CFG that might have totally messed - up the loop structure, then drop the old loop structure and - rebuild. */ - if (totally_clobbered_loops) - { - /* Release the current loop structures, they are totally - clobbered at this point. */ - loop_optimizer_finalize (); - current_loops = NULL; - - /* Similarly for dominance information. */ - free_dominance_info (CDI_DOMINATORS); - free_dominance_info (CDI_POST_DOMINATORS); - - /* Before we can rebuild the loop structures, we need dominators, - which requires no unreachable code. So remove unreachable code. */ - delete_unreachable_blocks (); - - /* Now rebuild the loop structures. */ - cfun->curr_properties &= ~PROP_loops; - loop_optimizer_init (AVOID_CFG_MODIFICATIONS); - cfun->curr_properties |= PROP_loops; - retval = 1; - } - - if (retval && current_loops) + if (retval) loops_state_set (LOOPS_NEED_FIXUP); return retval; |

