diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e4a951b1d22..4390fc74b44 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 * tree.def (SWITCH_EXPR): New tree node definition. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 9a808a80f8d..69610d6ec08 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -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);