diff options
author | steven <steven@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-10-31 21:37:10 +0000 |
---|---|---|
committer | steven <steven@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-10-31 21:37:10 +0000 |
commit | 9ccd9ece034984af0e6a775fdfb51b98a7029a84 (patch) | |
tree | 457138650afbcc0d91ef7e60a9f2ca4718a4b83d /gcc/cfganal.c | |
parent | 17819cc304ef1c3f04a4684226d8e079e5e71547 (diff) | |
download | gcc-9ccd9ece034984af0e6a775fdfb51b98a7029a84.tar.gz |
gcc/
PR tree-optimization/55018
* basic-block.h (dfs_find_deadend): New prototype.
* cfganal.c (dfs_find_deadend): No longer static. Use bitmap
instead of sbitmap for visited.
(flow_dfs_compute_reverse_execute): Use dfs_find_deadend here, too.
* dominance.c (calc_dfs_tree): If saw_unconnected,
traverse from dfs_find_deadend of unconnected b
instead of b directly.
testsuite/
PR tree-optimization/55018
* gcc.dg/torture/pr55018.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193047 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfganal.c')
-rw-r--r-- | gcc/cfganal.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gcc/cfganal.c b/gcc/cfganal.c index 58c763f8454..4bef629d13b 100644 --- a/gcc/cfganal.c +++ b/gcc/cfganal.c @@ -573,7 +573,9 @@ post_order_compute (int *post_order, bool include_entry_exit, } -/* Helper routine for inverted_post_order_compute. +/* Helper routine for inverted_post_order_compute + flow_dfs_compute_reverse_execute, and the reverse-CFG + deapth first search in dominance.c. BB has to belong to a region of CFG unreachable by inverted traversal from the exit. i.e. there's no control flow path from ENTRY to EXIT @@ -593,19 +595,17 @@ post_order_compute (int *post_order, bool include_entry_exit, that all blocks in the region are reachable by starting an inverted traversal from the returned block. */ -static basic_block +basic_block dfs_find_deadend (basic_block bb) { - sbitmap visited = sbitmap_alloc (last_basic_block); - bitmap_clear (visited); + bitmap visited = BITMAP_ALLOC (NULL); for (;;) { - SET_BIT (visited, bb->index); if (EDGE_COUNT (bb->succs) == 0 - || TEST_BIT (visited, EDGE_SUCC (bb, 0)->dest->index)) + || ! bitmap_set_bit (visited, bb->index)) { - sbitmap_free (visited); + BITMAP_FREE (visited); return bb; } @@ -958,7 +958,7 @@ flow_dfs_compute_reverse_execute (depth_first_search_ds data, /* Determine if there are unvisited basic blocks. */ FOR_BB_BETWEEN (bb, last_unvisited, NULL, prev_bb) if (!TEST_BIT (data->visited_blocks, bb->index)) - return bb; + return dfs_find_deadend (bb); return NULL; } |