diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1995-10-21 18:22:27 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1995-10-21 18:22:27 -0400 |
commit | 5dbcc9c0dcba41a85c67ed82a6198a06edb0b64c (patch) | |
tree | 508690a38e308a2a2f09b4e304f1d6afd75edb2b | |
parent | 00e94d6531c49dd28c277add21bc80831563f540 (diff) | |
download | gcc-5dbcc9c0dcba41a85c67ed82a6198a06edb0b64c.zip gcc-5dbcc9c0dcba41a85c67ed82a6198a06edb0b64c.tar.gz gcc-5dbcc9c0dcba41a85c67ed82a6198a06edb0b64c.tar.bz2 |
(find_barrier): Always use get_attr_length to compute length of instructions.
(find_barrier): Always use get_attr_length to compute length of
instructions. If count_hi or count_si out of range at end, need two
PREV_INSN calls not one.
From-SVN: r10496
-rw-r--r-- | gcc/config/sh/sh.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 8d29515..3a53b86 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -1213,14 +1213,11 @@ find_barrier (from) before the table. This gives 1020. */ while (from && count_si < 1020 && count_hi < 512) { - int inc; + int inc = get_attr_length (from); if (GET_CODE (from) == BARRIER) found_barrier = from; - /* Count the length of this insn - we assume that all moves will - be 2 bytes long, except the DImode/DFmode movess. */ - if (broken_move (from)) { rtx src = SET_SRC (PATTERN (from)); @@ -1237,10 +1234,7 @@ find_barrier (from) } else found_si = 1; - inc = (GET_MODE_SIZE (GET_MODE (src)) > 4) ? 4 : 2; } - else - inc = get_attr_length (from); if (GET_CODE (from) == INSN && GET_CODE (PATTERN (from)) == SET @@ -1270,8 +1264,14 @@ find_barrier (from) so we'll make one. */ rtx label = gen_label_rtx (); - /* We went one instruction too far above. */ - from = PREV_INSN (from); + /* If we exceeded the range, then we must back up over the last + instruction we looked at. Otherwise, we just need to undo the + NEXT_INSN at the end of the loop. */ + if (count_hi > 512 || count_si > 1020) + from = PREV_INSN (PREV_INSN (from)); + else + from = PREV_INSN (from); + /* Walk back to be just before any jump or label. Putting it before a label reduces the number of times the branch around the constant pool table will be hit. Putting it before |