tree-cfg.c (verify_stmts): Check that bb_for_stmt (stmt) == bb for every PHI node...
authorKazu Hirata <kazu@cs.umass.edu>
Mon, 14 Mar 2005 04:33:46 +0000 (04:33 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Mon, 14 Mar 2005 04:33:46 +0000 (04:33 +0000)
* tree-cfg.c (verify_stmts): Check that
bb_for_stmt (stmt) == bb for every PHI node and statement.

From-SVN: r96418

gcc/ChangeLog
gcc/tree-cfg.c

index eda99eb93f7e08e78895374d558487cd6663a6e3..a9a890c6007bf6e8c330a4e73fcb3524e41b4dd4 100644 (file)
@@ -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  <amodra@bigpond.net.au>
 
        * config.gcc: Remove excess indentation.
index ba04101724ec8766e5ef36758514c062ab7d6102..18fcab7ba8e935367d6ebc9e9da2bd6a1bab0a58 100644 (file)
@@ -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);