]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
bb-reorder.c (make_reorder_chain_1): Search harder for the vax casesi fallthru edge.
authorJohn David Anglin <dave@hiauly1.hia.nrc.ca>
Mon, 15 Jul 2002 16:19:39 +0000 (16:19 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Mon, 15 Jul 2002 16:19:39 +0000 (16:19 +0000)
* bb-reorder.c (make_reorder_chain_1): Search harder for the vax
casesi fallthru edge.
* cfgrtl.c (force_nonfallthru_and_redirect): Place redirection
block after ADDR_VEC.
* vax.md (casesi): Use emit_jump_insn.  Remove unused constraints.

From-SVN: r55460

gcc/ChangeLog
gcc/bb-reorder.c
gcc/cfgrtl.c
gcc/config/vax/vax.md

index 8166b8722f6f4c1c526391e4bbfec4f16b1556bb..3ae692d2874ab8185cbba4ab23ffbdd64d35e354 100644 (file)
@@ -1,3 +1,11 @@
+2002-07-15  John David Anglin  <dave@hiauly1.hia.nrc.ca>
+
+       * bb-reorder.c (make_reorder_chain_1): Search harder for the vax
+       casesi fallthru edge.
+       * cfgrtl.c (force_nonfallthru_and_redirect): Place redirection
+       block after ADDR_VEC.
+       * vax.md (casesi): Use emit_jump_insn.  Remove unused constraints.
+
 2002-07-15  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/7245
index 2578604889ec59ca76be6d57b19c7b0db0b67b43..b0cc46215ea6272dd2420cd00dcddd36a9cb55a8 100644 (file)
@@ -211,17 +211,21 @@ make_reorder_chain_1 (bb, prev)
   /* In the absence of a prediction, disturb things as little as possible
      by selecting the old "next" block from the list of successors.  If
      there had been a fallthru edge, that will be the one.  */
+  /* Note that the fallthru block may not be next any time we eliminate
+     forwarder blocks.  */
   if (! next)
     {
       for (e = bb->succ; e ; e = e->succ_next)
-       if (e->dest->index == bb->index + 1)
+       if (e->flags & EDGE_FALLTHRU)
          {
-           if ((e->flags & EDGE_FALLTHRU)
-               || (e->dest->succ
-                   && ! (e->flags & (EDGE_ABNORMAL_CALL | EDGE_EH))))
-             next = e->dest;
+           next = e->dest;
            break;
          }
+       else if (e->dest->index == bb->index + 1)
+         {
+           if (! (e->flags & (EDGE_ABNORMAL_CALL | EDGE_EH)))
+             next = e->dest;
+         }
     }
 
   /* Make sure we didn't select a silly next block.  */
index e57c88a7b5bc567271bf910409147e36686b161f..bbcdfbb1bfc5c9262183125b52f161cc85aefac5 100644 (file)
@@ -953,9 +953,21 @@ force_nonfallthru_and_redirect (e, target)
   if (e->src->succ->succ_next)
     {
       /* Create the new structures.  */
+
+      /* Position the new block correctly relative to loop notes.  */
       note = last_loop_beg_note (e->src->end);
-      jump_block
-       = create_basic_block (e->src->index + 1, NEXT_INSN (note), NULL);
+      note = NEXT_INSN (note);
+
+      /* ... and ADDR_VECs.  */
+      if (note != NULL
+         && GET_CODE (note) == CODE_LABEL
+         && NEXT_INSN (note)
+         && GET_CODE (NEXT_INSN (note)) == JUMP_INSN
+         && (GET_CODE (PATTERN (NEXT_INSN (note))) == ADDR_DIFF_VEC
+             || GET_CODE (PATTERN (NEXT_INSN (note))) == ADDR_VEC))
+       note = NEXT_INSN (NEXT_INSN (note));
+
+      jump_block = create_basic_block (e->src->index + 1, note, NULL);
       jump_block->count = e->count;
       jump_block->frequency = EDGE_FREQUENCY (e);
       jump_block->loop_depth = target->loop_depth;
index c19427908df3e44bde753e26c782e930a93700eb..5aa3621a4239982762b13b61bd8db189a07044c8 100644 (file)
 (define_expand "casesi"
   [(set (pc)
        (if_then_else
-        (leu (minus:SI (match_operand:SI 0 "general_operand" "g")
-                       (match_operand:SI 1 "general_operand" "g"))
-             (match_operand:SI 2 "general_operand" "g"))
+        (leu (minus:SI (match_operand:SI 0 "general_operand" "")
+                       (match_operand:SI 1 "general_operand" ""))
+             (match_operand:SI 2 "general_operand" ""))
         (plus:SI (sign_extend:SI
                   (mem:HI (plus:SI (mult:SI (minus:SI (match_dup 0)
                                                       (match_dup 1))
    (match_operand 4 "" "")]
   ""
   "
-  emit_insn (gen_casesi1 (operands[0], operands[1], operands[2], operands[3]));
+  emit_jump_insn (gen_casesi1 (operands[0], operands[1], operands[2], operands[3]));
   DONE;
 ")