aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfganal.c
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2015-10-13 22:10:45 +0000
committerTom de Vries <vries@gcc.gnu.org>2015-10-13 22:10:45 +0000
commita352b7102707500d1977c714d41d799b27de0a49 (patch)
treeb665ebf30f00014559d844b98d11bcc6741fb5bb /gcc/cfganal.c
parent179b8d05e9b773510208660d57f7e78504e75a9d (diff)
downloadgcc-a352b7102707500d1977c714d41d799b27de0a49.zip
gcc-a352b7102707500d1977c714d41d799b27de0a49.tar.gz
gcc-a352b7102707500d1977c714d41d799b27de0a49.tar.bz2
Check no unreachable blocks in inverted_post_order_compute
2015-10-14 Tom de Vries <tom@codesourcery.com> * cfganal.c (verify_no_unreachable_blocks): New function. (inverted_post_order_compute) [ENABLE_CHECKING]: Call verify_no_unreachable_blocks. cfganal.h (verify_no_unreachable_blocks): Declare. From-SVN: r228789
Diffstat (limited to 'gcc/cfganal.c')
-rw-r--r--gcc/cfganal.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/cfganal.c b/gcc/cfganal.c
index 279c3b5..1f935eb 100644
--- a/gcc/cfganal.c
+++ b/gcc/cfganal.c
@@ -193,6 +193,19 @@ find_unreachable_blocks (void)
free (worklist);
}
+
+/* Verify that there are no unreachable blocks in the current function. */
+
+void
+verify_no_unreachable_blocks (void)
+{
+ find_unreachable_blocks ();
+
+ basic_block bb;
+ FOR_EACH_BB_FN (bb, cfun)
+ gcc_assert ((bb->flags & BB_REACHABLE) != 0);
+}
+
/* Functions to access an edge list with a vector representation.
Enough data is kept such that given an index number, the
@@ -772,6 +785,10 @@ inverted_post_order_compute (int *post_order)
int post_order_num = 0;
sbitmap visited;
+#if ENABLE_CHECKING
+ verify_no_unreachable_blocks ();
+#endif
+
/* Allocate stack for back-tracking up CFG. */
stack = XNEWVEC (edge_iterator, n_basic_blocks_for_fn (cfun) + 1);
sp = 0;