Commit 2b9d17c7 by Andrew Haley Committed by Andrew Haley

sh.c (barrier_align): Check that an operand really is an insn before extracting its INSN_CODE.

2001-07-18  Andrew Haley  <aph@cambridge.redhat.com>

        * config/sh/sh.c (barrier_align): Check that an operand really is
        an insn before extracting its INSN_CODE.

From-SVN: r44303
parent 41971242
2001-07-18 Andrew Haley <aph@cambridge.redhat.com>
* config/sh/sh.c (barrier_align): Check that an operand really is
an insn before extracting its INSN_CODE.
2001-07-24 Andrew Haley <aph@cambridge.redhat.com> 2001-07-24 Andrew Haley <aph@cambridge.redhat.com>
* config/sh/sh.h (OVERRIDE_OPTIONS): Add braces to get rid of * config/sh/sh.h (OVERRIDE_OPTIONS): Add braces to get rid of
......
...@@ -2956,28 +2956,32 @@ barrier_align (barrier_or_label) ...@@ -2956,28 +2956,32 @@ barrier_align (barrier_or_label)
} }
if (prev if (prev
&& GET_CODE (prev) == JUMP_INSN && GET_CODE (prev) == JUMP_INSN
&& JUMP_LABEL (prev) && JUMP_LABEL (prev))
&& (jump_to_next || next_real_insn (JUMP_LABEL (prev)) == next {
rtx x;
if (jump_to_next
|| next_real_insn (JUMP_LABEL (prev)) == next
/* If relax_delay_slots() decides NEXT was redundant /* If relax_delay_slots() decides NEXT was redundant
with some previous instruction, it will have with some previous instruction, it will have
redirected PREV's jump to the following insn. */ redirected PREV's jump to the following insn. */
|| JUMP_LABEL (prev) == next_nonnote_insn (next) || JUMP_LABEL (prev) == next_nonnote_insn (next)
/* There is no upper bound on redundant instructions that /* There is no upper bound on redundant instructions that
might have been skipped, but we must not put an alignment might have been skipped, but we must not put an
where none had been before. */ alignment where none had been before. */
|| (INSN_CODE (NEXT_INSN (NEXT_INSN (PREV_INSN (prev)))) || (x = (NEXT_INSN (NEXT_INSN (PREV_INSN (prev)))),
== CODE_FOR_block_branch_redirect) (INSN_P (x)
|| (INSN_CODE (NEXT_INSN (NEXT_INSN (PREV_INSN (prev)))) && (INSN_CODE (x) == CODE_FOR_block_branch_redirect
== CODE_FOR_indirect_jump_scratch))) || INSN_CODE (x) == CODE_FOR_indirect_jump_scratch))))
{ {
rtx pat = PATTERN (prev); rtx pat = PATTERN (prev);
if (GET_CODE (pat) == PARALLEL) if (GET_CODE (pat) == PARALLEL)
pat = XVECEXP (pat, 0, 0); pat = XVECEXP (pat, 0, 0);
if (credit - slot >= (GET_CODE (SET_SRC (pat)) == PC ? 2 : 0)) if (credit - slot >= (GET_CODE (SET_SRC (pat)) == PC ? 2 : 0))
return 0; return 0;
} }
}
} }
return CACHE_LOG; return CACHE_LOG;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment