From e4dbb0d449e778bc810d0d627a5aaefd0d7847b1 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Sun, 20 Dec 2015 06:50:29 +0100 Subject: 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 --- gcc/cfganal.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'gcc/cfganal.c') 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) -- cgit v1.1