diff options
author | olegendo <olegendo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-07-09 22:39:25 +0000 |
---|---|---|
committer | olegendo <olegendo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-07-09 22:39:25 +0000 |
commit | 66bbc864460e7ad4601ae5b06f742138aa406f73 (patch) | |
tree | 5186288d56447f5edd79f75e301d3c9f75692402 /gcc/config | |
parent | ea863de10190e1ec3e81f89b4419f5deb609ea8e (diff) | |
download | ppe42-gcc-66bbc864460e7ad4601ae5b06f742138aa406f73.tar.gz ppe42-gcc-66bbc864460e7ad4601ae5b06f742138aa406f73.zip |
PR target/53886
* config/sh/sh.c (sequence_insn_p): New function.
(find_barrier, sh_insn_length_adjustment): Use it.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@189394 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/sh/sh.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index a53c3be91e9..015e274b13b 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -303,6 +303,7 @@ static int mov_insn_size (enum machine_mode, bool); static int max_mov_insn_displacement (enum machine_mode, bool); static int mov_insn_alignment_mask (enum machine_mode, bool); static HOST_WIDE_INT disp_addr_displacement (rtx); +static bool sequence_insn_p (rtx); static void sh_init_sync_libfuncs (void) ATTRIBUTE_UNUSED; @@ -4794,7 +4795,7 @@ find_barrier (int num_mova, rtx mova, rtx from) delay slot scheduler. */ if (JUMP_P (from) && !JUMP_TABLE_DATA_P (from) && get_attr_type (from) == TYPE_CBRANCH - && GET_CODE (PATTERN (NEXT_INSN (PREV_INSN (from)))) != SEQUENCE) + && ! sequence_insn_p (from)) inc += 2; if (found_si) @@ -9661,6 +9662,26 @@ fpscr_set_from_mem (int mode, HARD_REG_SET regs_live) #define IS_ASM_LOGICAL_LINE_SEPARATOR(C, STR) ((C) == ';') #endif +static bool +sequence_insn_p (rtx insn) +{ + rtx prev, next, pat; + + prev = PREV_INSN (insn); + if (prev == NULL) + return false; + + next = NEXT_INSN (prev); + if (next == NULL) + return false; + + pat = PATTERN (next); + if (pat == NULL) + return false; + + return GET_CODE (pat) == SEQUENCE; +} + int sh_insn_length_adjustment (rtx insn) { @@ -9671,7 +9692,7 @@ sh_insn_length_adjustment (rtx insn) && GET_CODE (PATTERN (insn)) != CLOBBER) || CALL_P (insn) || (JUMP_P (insn) && !JUMP_TABLE_DATA_P (insn))) - && GET_CODE (PATTERN (NEXT_INSN (PREV_INSN (insn)))) != SEQUENCE + && ! sequence_insn_p (insn) && get_attr_needs_delay_slot (insn) == NEEDS_DELAY_SLOT_YES) return 2; @@ -9680,7 +9701,7 @@ sh_insn_length_adjustment (rtx insn) if (sh_cpu_attr == CPU_SH2E && JUMP_P (insn) && !JUMP_TABLE_DATA_P (insn) && get_attr_type (insn) == TYPE_CBRANCH - && GET_CODE (PATTERN (NEXT_INSN (PREV_INSN (insn)))) != SEQUENCE) + && ! sequence_insn_p (insn)) return 2; /* sh-dsp parallel processing insn take four bytes instead of two. */ |