dominance.c (verify_dominators): Don't SEGV if recount_dominator returns NULL.
authorFrank Ch. Eigler <fche@redhat.com>
Wed, 22 Sep 2004 20:36:14 +0000 (20:36 +0000)
committerFrank Ch. Eigler <fche@gcc.gnu.org>
Wed, 22 Sep 2004 20:36:14 +0000 (20:36 +0000)
2004-09-22  Frank Ch. Eigler  <fche@redhat.com>

* dominance.c (verify_dominators): Don't SEGV if recount_dominator
returns NULL.

From-SVN: r87883

gcc/ChangeLog
gcc/dominance.c

index 203a65bb44f9d43d1f2d98d7f025b289fe81610b..0d59f07fa3376c05eb48d13e9a446b0395a085b3 100644 (file)
@@ -1,3 +1,8 @@
+2004-09-22  Frank Ch. Eigler  <fche@redhat.com>
+
+       * dominance.c (verify_dominators): Don't SEGV if recount_dominator
+       returns NULL.
+
 2004-09-22  Kazu Hirata  <kazu@cs.umass.edu>
 
        * doc/c-tree.texi (TRUTH_NOT_EXPR, TRUTH_ANDIF_EXPR,
index 278254719af907232cebda09c588e8fccf3ee258..ef40b545e8c1230da2c25ad79f24f3ba84100bc7 100644 (file)
@@ -833,8 +833,12 @@ verify_dominators (enum cdi_direction dir)
       dom_bb = recount_dominator (dir, bb);
       if (dom_bb != get_immediate_dominator (dir, bb))
        {
-         error ("dominator of %d should be %d, not %d",
-          bb->index, dom_bb->index, get_immediate_dominator(dir, bb)->index);
+         if (dom_bb == NULL)
+           error ("dominator of %d should be (unknown), not %d",
+                  bb->index, get_immediate_dominator(dir, bb)->index);
+         else
+           error ("dominator of %d should be %d, not %d",
+                  bb->index, dom_bb->index, get_immediate_dominator(dir, bb)->index);
          err = 1;
        }
     }