From 973bf48f6661ea6e2e0e4c74a0d65303061016aa Mon Sep 17 00:00:00 2001 From: kazu Date: Mon, 14 Mar 2005 04:33:46 +0000 Subject: [PATCH] * tree-cfg.c (verify_stmts): Check that bb_for_stmt (stmt) == bb for every PHI node and statement. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96418 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 3 +++ gcc/tree-cfg.c | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index eda99eb..a9a890c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -10,6 +10,9 @@ Make them static. * hard-reg-set.h: Remove the corresponding declarations. + * tree-cfg.c (verify_stmts): Check that + bb_for_stmt (stmt) == bb for every PHI node and statement. + 2005-03-14 Alan Modra * config.gcc: Remove excess indentation. diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index ba04101..18fcab7 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -3696,6 +3696,12 @@ verify_stmts (void) { int phi_num_args = PHI_NUM_ARGS (phi); + if (bb_for_stmt (phi) != bb) + { + error ("bb_for_stmt (phi) is set to a wrong basic block\n"); + err |= true; + } + for (i = 0; i < phi_num_args; i++) { tree t = PHI_ARG_DEF (phi, i); @@ -3734,6 +3740,13 @@ verify_stmts (void) for (bsi = bsi_start (bb); !bsi_end_p (bsi); ) { tree stmt = bsi_stmt (bsi); + + if (bb_for_stmt (stmt) != bb) + { + error ("bb_for_stmt (stmt) is set to a wrong basic block\n"); + err |= true; + } + bsi_next (&bsi); err |= verify_stmt (stmt, bsi_end_p (bsi)); addr = walk_tree (&stmt, verify_node_sharing, htab, NULL); -- 2.7.4