diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2015-12-20 06:50:29 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2015-12-20 05:50:29 +0000 |
commit | e4dbb0d449e778bc810d0d627a5aaefd0d7847b1 (patch) | |
tree | 4c773d3276204110d797dfcd28b3e1f57d3fbbf6 /gcc/cfganal.c | |
parent | e07e03ddc14c0cb38b388812c9d5d07fd940a78f (diff) | |
download | gcc-e4dbb0d449e778bc810d0d627a5aaefd0d7847b1.zip gcc-e4dbb0d449e778bc810d0d627a5aaefd0d7847b1.tar.gz gcc-e4dbb0d449e778bc810d0d627a5aaefd0d7847b1.tar.bz2 |
re PR tree-optimization/65337 (LTO bootstrap failure with Ada enabled)
PR middle-end/65337
* tree-ssa-dce.c (bb_postorder): New static var.
(forward_edge_to_pdom): Remove.
(remove_dead_stmt): Instead of redirecting edges only keep an edge
on a path to nearest live BB.
(eliminate_unnecessary_stmts): Free bb_postorder.
* cfganal.c (dfs_find_deadend): Add START_POINTES.
* cfganal.h (inverted_post_order_compute): Update prototype.
From-SVN: r231856
Diffstat (limited to 'gcc/cfganal.c')
-rw-r--r-- | gcc/cfganal.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/gcc/cfganal.c b/gcc/cfganal.c index 0f26038..b020b32 100644 --- a/gcc/cfganal.c +++ b/gcc/cfganal.c @@ -759,6 +759,9 @@ dfs_find_deadend (basic_block bb) (from successors to predecessors). This ordering can be used for forward dataflow problems among others. + Optionally if START_POINTS is specified, start from exit block and all + basic blocks in START_POINTS. This is used by CD-DCE. + This function assumes that all blocks in the CFG are reachable from the ENTRY (but not necessarily from EXIT). @@ -776,7 +779,8 @@ dfs_find_deadend (basic_block bb) and do another inverted traversal from that block. */ int -inverted_post_order_compute (int *post_order) +inverted_post_order_compute (int *post_order, + sbitmap *start_points) { basic_block bb; edge_iterator *stack; @@ -797,6 +801,22 @@ inverted_post_order_compute (int *post_order) /* None of the nodes in the CFG have been visited yet. */ bitmap_clear (visited); + if (start_points) + { + FOR_ALL_BB_FN (bb, cfun) + if (bitmap_bit_p (*start_points, bb->index) + && EDGE_COUNT (bb->preds) > 0) + { + stack[sp++] = ei_start (bb->preds); + bitmap_set_bit (visited, bb->index); + } + if (EDGE_COUNT (EXIT_BLOCK_PTR_FOR_FN (cfun)->preds)) + { + stack[sp++] = ei_start (EXIT_BLOCK_PTR_FOR_FN (cfun)->preds); + bitmap_set_bit (visited, EXIT_BLOCK_PTR_FOR_FN (cfun)->index); + } + } + else /* Put all blocks that have no successor into the initial work list. */ FOR_ALL_BB_FN (bb, cfun) if (EDGE_COUNT (bb->succs) == 0) |