arm.c (find_barrier): Revert change of Apr 23.
authorRichard Earnshaw <rearnsha@arm.com>
Wed, 23 Sep 1998 10:49:06 +0000 (10:49 +0000)
committerRichard Earnshaw <rearnsha@gcc.gnu.org>
Wed, 23 Sep 1998 10:49:06 +0000 (10:49 +0000)
* arm.c (find_barrier): Revert change of Apr 23.  Handle table
jumps as a single entity, taking into account the size of the
table.

From-SVN: r22558

gcc/ChangeLog
gcc/config/arm/arm.c

index e4a951b..4390fc7 100644 (file)
@@ -1,3 +1,9 @@
+Wed Sep 23 10:45:44 1998  Richard Earnshaw (rearnsha@arm.com)
+
+       * arm.c (find_barrier): Revert change of Apr 23.  Handle table
+       jumps as a single entity, taking into account the size of the
+       table.
+
 Tue Sep 22 15:13:34 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
 
        * tree.def (SWITCH_EXPR): New tree node definition.
index 9a808a8..69610d6 100644 (file)
@@ -3592,8 +3592,10 @@ find_barrier (from, max_count)
 
   while (from && count < max_count)
     {
+      rtx tmp;
+
       if (GET_CODE (from) == BARRIER)
-       return from;
+       found_barrier = from;
 
       /* Count the length of this insn */
       if (GET_CODE (from) == INSN
@@ -3601,6 +3603,24 @@ find_barrier (from, max_count)
          && CONSTANT_P (SET_SRC (PATTERN (from)))
          && CONSTANT_POOL_ADDRESS_P (SET_SRC (PATTERN (from))))
        count += 8;
+      /* Handle table jumps as a single entity.  */
+      else if (GET_CODE (from) == JUMP_INSN
+              && JUMP_LABEL (from) != 0
+              && ((tmp = next_real_insn (JUMP_LABEL (from)))
+                  == next_real_insn (from))
+              && tmp != NULL
+              && GET_CODE (tmp) == JUMP_INSN
+              && (GET_CODE (PATTERN (tmp)) == ADDR_VEC
+                  || GET_CODE (PATTERN (tmp)) == ADDR_DIFF_VEC))
+       {
+         int elt = GET_CODE (PATTERN (tmp)) == ADDR_DIFF_VEC ? 1 : 0;
+         count += (get_attr_length (from)
+                   + GET_MODE_SIZE (SImode) * XVECLEN (PATTERN (tmp), elt));
+         /* Continue after the dispatch table.  */
+         last = from;
+         from = NEXT_INSN (tmp);
+         continue;
+       }
       else
        count += get_attr_length (from);