diff options
author | Trevor Saunders <tbsaunde+gcc@tbsaunde.org> | 2016-09-22 13:16:41 +0000 |
---|---|---|
committer | Trevor Saunders <tbsaunde@gcc.gnu.org> | 2016-09-22 13:16:41 +0000 |
commit | 7c9796eddb1a8acbcc8db02276a429cd25d98a7c (patch) | |
tree | 0267556b73019ac1ac180982195b11798af482d9 /gcc/config | |
parent | 1f00691e9b28370c9e9986afc46dd9f7c42024bc (diff) | |
download | gcc-7c9796eddb1a8acbcc8db02276a429cd25d98a7c.zip gcc-7c9796eddb1a8acbcc8db02276a429cd25d98a7c.tar.gz gcc-7c9796eddb1a8acbcc8db02276a429cd25d98a7c.tar.bz2 |
make next/prev active_insn and active_insn_p take rtx_insn *
gcc/ChangeLog:
2016-09-22 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* emit-rtl.c (next_active_insn): Change argument type to
rtx_insn *.
(prev_active_insn): Likewise.
(active_insn_p): Likewise.
* rtl.h: Adjust prototypes.
* cfgcleanup.c (merge_blocks_move_successor_nojumps): Adjust.
* config/arc/arc.md: Likewise.
* config/pa/pa.c (branch_to_delay_slot_p): Likewise.
(branch_needs_nop_p): Likewise.
(use_skip_p): Likewise.
* config/sh/sh.c (gen_block_redirect): Likewise.
(split_branches): Likewise.
* reorg.c (optimize_skip): Likewise.
(fill_simple_delay_slots): Likewise.
(fill_slots_from_thread): Likewise.
(relax_delay_slots): Likewise.
* resource.c (mark_target_live_regs): Likewise.
From-SVN: r240361
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/arc/arc.md | 33 | ||||
-rw-r--r-- | gcc/config/pa/pa.c | 6 | ||||
-rw-r--r-- | gcc/config/sh/sh.c | 8 |
3 files changed, 30 insertions, 17 deletions
diff --git a/gcc/config/arc/arc.md b/gcc/config/arc/arc.md index 22fdbba..ac7346bc 100644 --- a/gcc/config/arc/arc.md +++ b/gcc/config/arc/arc.md @@ -5122,16 +5122,29 @@ scan = as_a <rtx_insn *> (XEXP (SET_SRC (PATTERN (scan)), 0)); continue; } - if (JUMP_LABEL (scan) - /* JUMP_LABEL might be simple_return instead if an insn. */ - && (!INSN_P (JUMP_LABEL (scan)) - || (!next_active_insn (JUMP_LABEL (scan)) - || (recog_memoized (next_active_insn (JUMP_LABEL (scan))) - != CODE_FOR_doloop_begin_i))) - && (!next_active_insn (NEXT_INSN (PREV_INSN (scan))) - || (recog_memoized - (next_active_insn (NEXT_INSN (PREV_INSN (scan)))) - != CODE_FOR_doloop_begin_i))) + + rtx lab = JUMP_LABEL (scan); + if (!lab) + break; + + rtx_insn *next_scan + = next_active_insn (NEXT_INSN (PREV_INSN (scan))); + if (next_scan + && recog_memoized (next_scan) != CODE_FOR_doloop_begin_i) + break; + + /* JUMP_LABEL might be simple_return instead if an insn. */ + if (!INSN_P (lab)) + { + n_insns++; + break; + } + + rtx_insn *next_lab = next_active_insn (as_a<rtx_insn *> (lab)); + if (next_lab + && recog_memoized (next_lab) != CODE_FOR_doloop_begin_i) + break; + n_insns++; } break; diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 18b7324..a02010c 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -6445,7 +6445,7 @@ branch_to_delay_slot_p (rtx_insn *insn) if (dbr_sequence_length ()) return FALSE; - jump_insn = next_active_insn (JUMP_LABEL (insn)); + jump_insn = next_active_insn (JUMP_LABEL_AS_INSN (insn)); while (insn) { insn = next_active_insn (insn); @@ -6479,7 +6479,7 @@ branch_needs_nop_p (rtx_insn *insn) if (dbr_sequence_length ()) return FALSE; - jump_insn = next_active_insn (JUMP_LABEL (insn)); + jump_insn = next_active_insn (JUMP_LABEL_AS_INSN (insn)); while (insn) { insn = next_active_insn (insn); @@ -6502,7 +6502,7 @@ branch_needs_nop_p (rtx_insn *insn) static bool use_skip_p (rtx_insn *insn) { - rtx_insn *jump_insn = next_active_insn (JUMP_LABEL (insn)); + rtx_insn *jump_insn = next_active_insn (JUMP_LABEL_AS_INSN (insn)); while (insn) { diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index b3e949e..a9b5a14 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -5503,7 +5503,8 @@ gen_block_redirect (rtx_insn *jump, int addr, int need_block) else if (optimize && need_block >= 0) { - rtx_insn *next = next_active_insn (next_active_insn (dest)); + rtx_insn *next = next_active_insn (as_a<rtx_insn *> (dest)); + next = next_active_insn (next); if (next && JUMP_P (next) && GET_CODE (PATTERN (next)) == SET && recog_memoized (next) == CODE_FOR_jump_compact) @@ -6395,9 +6396,8 @@ split_branches (rtx_insn *first) /* We can't use JUMP_LABEL here because it might be undefined when not optimizing. */ /* A syntax error might cause beyond to be NULL_RTX. */ - beyond - = next_active_insn (XEXP (XEXP (SET_SRC (PATTERN (insn)), 1), - 0)); + rtx temp = XEXP (XEXP (SET_SRC (PATTERN (insn)), 1), 0); + beyond = next_active_insn (as_a<rtx_insn *> (temp)); if (beyond && (JUMP_P (beyond) |