re PR rtl-optimization/10024 ([HP-PA] inline optimization ICE)
authorJan Hubicka <jh@suse.cz>
Mon, 7 Apr 2003 12:36:59 +0000 (14:36 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Mon, 7 Apr 2003 12:36:59 +0000 (12:36 +0000)
PR opt/10024
* cfglayout.c (cfg_layout_redirect_edge):
Redirect any branch edges unified with the fallthru one.
* cfgrtl.c (force_nonfallthru_and_redirect):  Do not special
case fallthru edges when called via cfglayout.c

From-SVN: r65330

gcc/ChangeLog
gcc/cfglayout.c
gcc/cfgrtl.c

index 38ed2cbfccac3e73d16a198b30edba2077247949..8fa41fd4ebec688646cf0745dac7121c5afe1527 100644 (file)
@@ -1,3 +1,11 @@
+Mon Apr  7 14:36:24 CEST 2003  Jan Hubicka  <jh@suse.cz>
+
+       PR opt/10024
+       * cfglayout.c (cfg_layout_redirect_edge):
+       Redirect any branch edges unified with the fallthru one.
+       * cfgrtl.c (force_nonfallthru_and_redirect):  Do not special
+       case fallthru edges when called via cfglayout.c
+
 2003-04-07  J"orn Rennecke <joern.rennecke@superh.com>
 
        * c-typeck.c (output_init_element): Check for type == error_mark_node.
index b5be7ca29b32f67a498149e8761cb091607f60bb..3420bd1322a4e0493b407148f3b38a147dce2283 100644 (file)
@@ -904,6 +904,13 @@ cfg_layout_redirect_edge (e, dest)
   src->next_bb = NULL;
   if (e->flags & EDGE_FALLTHRU)
     {
+      /* Redirect any branch edges unified with the fallthru one.  */
+      if (GET_CODE (src->end) == JUMP_INSN
+         && JUMP_LABEL (src->end) == e->dest->head)
+       {
+          if (!redirect_jump (src->end, block_label (dest), 0))
+           abort ();
+       }
       /* In case we are redirecting fallthru edge to the branch edge
          of conditional jump, remove it.  */
       if (src->succ->succ_next
index 185676b9041c88214fc6a9137d087668212d5b38..1683ca48e218a24173a3bdd40645af2d2377f58c 100644 (file)
@@ -927,6 +927,9 @@ force_nonfallthru_and_redirect (e, target)
      by creating an basic block afterwards to redirect fallthru edge.  */
   if (e->src != ENTRY_BLOCK_PTR && e->dest != EXIT_BLOCK_PTR
       && any_condjump_p (e->src->end)
+      /* When called from cfglayout, fallthru edges do not
+         neccessarily go to the next block.  */
+      && e->src->next_bb == e->dest
       && JUMP_LABEL (e->src->end) == e->dest->head)
     {
       rtx note;