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/dominance.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/dominance.c')
-rw-r--r-- | gcc/dominance.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/dominance.c b/gcc/dominance.c index 10a58cd8a2a..683f3f5573f 100644 --- a/gcc/dominance.c +++ b/gcc/dominance.c @@ -377,14 +377,18 @@ calc_dfs_tree (struct dom_info *di, bool reverse) { FOR_EACH_BB_REVERSE (b) { + basic_block b2; if (di->dfs_order[b->index]) continue; - bitmap_set_bit (di->fake_exit_edge, b->index); - di->dfs_order[b->index] = di->dfsnum; - di->dfs_to_bb[di->dfsnum] = b; + b2 = dfs_find_deadend (b); + gcc_checking_assert (di->dfs_order[b2->index] == 0); + bitmap_set_bit (di->fake_exit_edge, b2->index); + di->dfs_order[b2->index] = di->dfsnum; + di->dfs_to_bb[di->dfsnum] = b2; di->dfs_parent[di->dfsnum] = di->dfs_order[last_basic_block]; di->dfsnum++; - calc_dfs_tree_nonrec (di, b, reverse); + calc_dfs_tree_nonrec (di, b2, reverse); + gcc_checking_assert (di->dfs_order[b->index]); } } } |