cfgrtl.c (force_nonfallthru_and_redirect): Allow abnormal edge to be forced into...
authorJan Hubicka <jh@suse.cz>
Wed, 4 Dec 2002 14:21:58 +0000 (15:21 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Wed, 4 Dec 2002 14:21:58 +0000 (14:21 +0000)
* cfgrtl.c (force_nonfallthru_and_redirect):  Allow abnormal edge
to be forced into nonfallthru.

From-SVN: r59816

gcc/ChangeLog
gcc/cfgrtl.c

index 88cf1472eab49c8b1e1b5be666cfd9cec30a41f2..4667a64cd67cebd44f36f26656d3cb896c602f82 100644 (file)
@@ -1,3 +1,8 @@
+Wed Dec  4 15:20:54 CET 2002  Jan Hubicka  <jh@suse.cz>
+
+       * cfgrtl.c (force_nonfallthru_and_redirect):  Allow abnormal edge
+       to be forced into nonfallthru.
+
 2002-12-03  Jason Thorpe  <thorpej@wasabisystems.com>
 
        * config/t-netbsd (USER_H): Set to $(EXTRA_HEADERS).
index a72123911f9069f4899ecbaf534df8b2e6011430..84e62c6850e3590d7db39c0122052f5db9d47aba 100644 (file)
@@ -933,12 +933,23 @@ force_nonfallthru_and_redirect (e, target)
      edge e;
      basic_block target;
 {
-  basic_block jump_block, new_bb = NULL;
+  basic_block jump_block, new_bb = NULL, src = e->src;
   rtx note;
   edge new_edge;
+  int abnormal_edge_flags = 0;
 
   if (e->flags & EDGE_ABNORMAL)
-    abort ();
+    {
+      /* Irritating special case - fallthru edge to the same block as abnormal
+        edge.
+        We can't redirect abnormal edge, but we still can split the fallthru
+        one and create separate abnormal edge to original destination. 
+        This allows bb-reorder to make such edge non-fallthru.  */
+      if (e->dest != target)
+       abort ();
+      abnormal_edge_flags = e->flags & ~(EDGE_FALLTHRU | EDGE_CAN_FALLTHRU);
+      e->flags &= EDGE_FALLTHRU | EDGE_CAN_FALLTHRU;
+    }
   else if (!(e->flags & EDGE_FALLTHRU))
     abort ();
   else if (e->src == ENTRY_BLOCK_PTR)
@@ -962,7 +973,7 @@ force_nonfallthru_and_redirect (e, target)
       make_single_succ_edge (ENTRY_BLOCK_PTR, bb, EDGE_FALLTHRU);
     }
 
-  if (e->src->succ->succ_next)
+  if (e->src->succ->succ_next || abnormal_edge_flags)
     {
       /* Create the new structures.  */
 
@@ -1029,6 +1040,9 @@ force_nonfallthru_and_redirect (e, target)
   emit_barrier_after (jump_block->end);
   redirect_edge_succ_nodup (e, target);
 
+  if (abnormal_edge_flags)
+    make_edge (src, target, abnormal_edge_flags);
+
   return new_bb;
 }