aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAndrew Haley <aph@cambridge.redhat.com>2001-07-24 15:25:51 +0000
committerAndrew Haley <aph@gcc.gnu.org>2001-07-24 15:25:51 +0000
commit2b9d17c73c1b69e3e61a010ce31723338713a02d (patch)
tree12a74f32067a0a22ece4d83fc4ae3a800b22a6d0 /gcc
parent41971242ccca8d431b01c3aadf36ab3867f86ab7 (diff)
downloadgcc-2b9d17c73c1b69e3e61a010ce31723338713a02d.zip
gcc-2b9d17c73c1b69e3e61a010ce31723338713a02d.tar.gz
gcc-2b9d17c73c1b69e3e61a010ce31723338713a02d.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/sh/sh.c36
2 files changed, 25 insertions, 16 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d2c4334..bea9ac4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+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>
* config/sh/sh.h (OVERRIDE_OPTIONS): Add braces to get rid of
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index ec09d08..a981369 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -2956,28 +2956,32 @@ barrier_align (barrier_or_label)
}
if (prev
&& GET_CODE (prev) == JUMP_INSN
- && JUMP_LABEL (prev)
- && (jump_to_next || next_real_insn (JUMP_LABEL (prev)) == next
+ && JUMP_LABEL (prev))
+ {
+ rtx x;
+ if (jump_to_next
+ || next_real_insn (JUMP_LABEL (prev)) == next
/* If relax_delay_slots() decides NEXT was redundant
with some previous instruction, it will have
redirected PREV's jump to the following insn. */
|| JUMP_LABEL (prev) == next_nonnote_insn (next)
/* There is no upper bound on redundant instructions that
- might have been skipped, but we must not put an alignment
- where none had been before. */
- || (INSN_CODE (NEXT_INSN (NEXT_INSN (PREV_INSN (prev))))
- == CODE_FOR_block_branch_redirect)
- || (INSN_CODE (NEXT_INSN (NEXT_INSN (PREV_INSN (prev))))
- == CODE_FOR_indirect_jump_scratch)))
- {
- rtx pat = PATTERN (prev);
- if (GET_CODE (pat) == PARALLEL)
- pat = XVECEXP (pat, 0, 0);
- if (credit - slot >= (GET_CODE (SET_SRC (pat)) == PC ? 2 : 0))
- return 0;
- }
+ might have been skipped, but we must not put an
+ alignment where none had been before. */
+ || (x = (NEXT_INSN (NEXT_INSN (PREV_INSN (prev)))),
+ (INSN_P (x)
+ && (INSN_CODE (x) == CODE_FOR_block_branch_redirect
+ || INSN_CODE (x) == CODE_FOR_indirect_jump_scratch))))
+ {
+ rtx pat = PATTERN (prev);
+ if (GET_CODE (pat) == PARALLEL)
+ pat = XVECEXP (pat, 0, 0);
+ if (credit - slot >= (GET_CODE (SET_SRC (pat)) == PC ? 2 : 0))
+ return 0;
+ }
+ }
}
-
+
return CACHE_LOG;
}