cfgcleanup.c (outgoing_edges_match): Check for insn match with a single outgoing...
authorRichard Henderson <rth@redhat.com>
Mon, 17 Dec 2001 18:21:36 +0000 (10:21 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Mon, 17 Dec 2001 18:21:36 +0000 (10:21 -0800)
        * cfgcleanup.c (outgoing_edges_match): Check for insn match with
        a single outgoing edge too.

From-SVN: r48114

gcc/ChangeLog
gcc/cfgcleanup.c

index 289bec38eaa0cc12f9bcd4cbd3bacdf20d9f555e..e508636e3b23eb0fd9dc113640c249caf7b32175 100644 (file)
@@ -1,3 +1,8 @@
+2001-12-17  Richard Henderson  <rth@redhat.com>
+
+       * cfgcleanup.c (outgoing_edges_match): Check for insn match with
+       a single outgoing edge too.
+
 Mon Dec 17 18:27:52 CET 2001  Jan Hubicka  <jh@suse.cz>
 
        * cfgrtl.c (redirect_edge_and_branch):  Do simplify abnormal
index d13e3a053498125c16f3e0c79b57888428d401ba..b23def8b3bc328ffe2f1ca3d39df88d81beafea8 100644 (file)
@@ -956,11 +956,14 @@ outgoing_edges_match (mode, bb1, bb2)
   edge fallthru1 = 0, fallthru2 = 0;
   edge e1, e2;
 
-  /* If BB1 has only one successor, we must be looking at an unconditional
-     jump.  Which, by the assumption above, means that we only need to check
-     that BB2 has one successor.  */
+  /* If BB1 has only one successor, we may be looking at either an
+     unconditional jump, or a fake edge to exit.  */
   if (bb1->succ && !bb1->succ->succ_next)
-    return (bb2->succ && !bb2->succ->succ_next);
+    {
+      if (! bb2->succ || bb2->succ->succ_next)
+       return false;
+      return insns_match_p (mode, bb1->end, bb2->end);
+    }
 
   /* Match conditional jumps - this may get tricky when fallthru and branch
      edges are crossed.  */