aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Eckhardt <jle@cygnus.com>2000-05-03 16:39:55 +0000
committerJason Eckhardt <jle@gcc.gnu.org>2000-05-03 16:39:55 +0000
commit18ca529b1976bfdc7f84b96f93d0ac3f483bf7f8 (patch)
tree47b0707ffe3783fb75b890728aeafe96645da837 /gcc
parent754ac8f7b2d97cbb4adbb355865fd01e69c73a1e (diff)
downloadgcc-18ca529b1976bfdc7f84b96f93d0ac3f483bf7f8.zip
gcc-18ca529b1976bfdc7f84b96f93d0ac3f483bf7f8.tar.gz
gcc-18ca529b1976bfdc7f84b96f93d0ac3f483bf7f8.tar.bz2
flow.c (verify_flow_info): Added two more sanity checks.
Tue May 2 00:20:30 2000 Jason Eckhardt <jle@cygnus.com> * flow.c (verify_flow_info): Added two more sanity checks. The first checks that the blocks are numbered consecutively. The second checks that n_basic_blocks is actually equal to the number of basic blocks in the insn chain. From-SVN: r33632
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/flow.c18
2 files changed, 24 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b28cacc..267ce89 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+Tue May 2 00:20:30 2000 Jason Eckhardt <jle@cygnus.com>
+
+ * flow.c (verify_flow_info): Added two more sanity checks. The
+ first checks that the blocks are numbered consecutively. The second
+ checks that n_basic_blocks is actually equal to the number of
+ basic blocks in the insn chain.
+
2000-05-03 Zack Weinberg <zack@wolery.cumb.org>
* cpplib.h: Add accessor macros for token lists.
diff --git a/gcc/flow.c b/gcc/flow.c
index f0cee82..08f1f0a 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -6177,7 +6177,7 @@ verify_flow_info ()
const rtx rtx_first = get_insns ();
basic_block *bb_info;
rtx x;
- int i, err = 0;
+ int i, last_bb_num_seen, num_bb_notes, err = 0;
bb_info = (basic_block *) xcalloc (max_uid, sizeof (basic_block));
@@ -6340,9 +6340,21 @@ verify_flow_info ()
}
}
+ last_bb_num_seen = -1;
+ num_bb_notes = 0;
x = rtx_first;
while (x)
{
+ if (GET_CODE (x) == NOTE
+ && NOTE_LINE_NUMBER (x) == NOTE_INSN_BASIC_BLOCK)
+ {
+ basic_block bb = NOTE_BASIC_BLOCK (x);
+ num_bb_notes++;
+ if (bb->index != last_bb_num_seen + 1)
+ fatal ("Basic blocks not numbered consecutively");
+ last_bb_num_seen = bb->index;
+ }
+
if (!bb_info[INSN_UID (x)])
{
switch (GET_CODE (x))
@@ -6378,6 +6390,10 @@ verify_flow_info ()
x = NEXT_INSN (x);
}
+ if (num_bb_notes != n_basic_blocks)
+ fatal ("number of bb notes in insn chain (%d) != n_basic_blocks (%d)",
+ num_bb_notes, n_basic_blocks);
+
if (err)
abort ();