diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-10-07 02:25:57 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-10-07 02:25:57 +0000 |
commit | a27d141e3ebf8a1257cee3876e9d210c26421994 (patch) | |
tree | 38f2371bdfbd8f8e7bf213eb5d5aa9aa8733c0f7 /gcc/tree-ssa-dom.c | |
parent | 28cb74c5424a2ad481d0d84c384a0e38929503ef (diff) | |
download | gcc-a27d141e3ebf8a1257cee3876e9d210c26421994.tar.gz |
[PATCH][PR tree-optimization/67816] Fix jump threading when DOM removes conditionals in jump threading path
PR tree-optimization/67816
* tree-ssa-threadupdate.h (remove_jump_threads_including): Renamed
from remove_jump_threads_starting_at. Accept an edge rather than
a basic block.
* tree-ssa-threadupdate.c (removed_edges): New hash table.
(remove_jump_threads_including): Note edges that get removed from
the CFG for later pruning of jump threading paths including them.
(thread_through_all_blocks): Remove paths which include edges that
have been removed.
* tree-ssa-dom.c (optimize_stmt): Call remove_jump_threads_including
on each outgoing edges when optimizing away a control statement.
* gcc.c-torture/compile/pr67816.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@228559 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-dom.c')
-rw-r--r-- | gcc/tree-ssa-dom.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c index c226da55340..941087d56de 100644 --- a/gcc/tree-ssa-dom.c +++ b/gcc/tree-ssa-dom.c @@ -1840,8 +1840,13 @@ optimize_stmt (basic_block bb, gimple_stmt_iterator si, edge taken_edge = find_taken_edge (bb, val); if (taken_edge) { - /* Delete threads that start at BB. */ - remove_jump_threads_starting_at (bb); + + /* We need to remove any queued jump threads that + reference outgoing edges from this block. */ + edge_iterator ei; + edge e; + FOR_EACH_EDGE (e, ei, bb->succs) + remove_jump_threads_including (e); /* If BB is in a loop, then removing an outgoing edge from BB may cause BB to move outside the loop, changes in the |