diff options
author | dmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-08-19 00:54:22 +0000 |
---|---|---|
committer | dmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-08-19 00:54:22 +0000 |
commit | 4a57a2e8e72b95cfc29bec6280314d0a8e4f0d0f (patch) | |
tree | 03e829aeeea83ad9c7386f8e4821c145e377edbe /gcc | |
parent | 7ad1fa02b07412c7d7d6f3eefec101f988363698 (diff) | |
download | gcc-4a57a2e8e72b95cfc29bec6280314d0a8e4f0d0f.tar.gz |
Split NEXT_INSN/PREV_INSN into lvalue and rvalue forms
/
2014-08-19 David Malcolm <dmalcolm@redhat.com>
* rtx-classes-status.txt: Add SET_NEXT_INSN, SET_PREV_INSN.
gcc/
2014-08-19 David Malcolm <dmalcolm@redhat.com>
* rtl.h (PREV_INSN): Split macro in two: the existing one,
for rvalues, and...
(SET_PREV_INSN): New macro, for use as an lvalue.
(NEXT_INSN, SET_NEXT_INSN): Likewise.
* caller-save.c (save_call_clobbered_regs): Convert lvalue use of
PREV_INSN/NEXT_INSN into SET_PREV_INSN/SET_NEXT_INSN.
* cfgrtl.c (try_redirect_by_replacing_jump): Likewise.
(fixup_abnormal_edges): Likewise.
(unlink_insn_chain): Likewise.
(fixup_reorder_chain): Likewise.
(cfg_layout_delete_block): Likewise.
(cfg_layout_merge_blocks): Likewise.
* combine.c (update_cfg_for_uncondjump): Likewise.
* emit-rtl.c (link_insn_into_chain): Likewise.
(remove_insn): Likewise.
(delete_insns_since): Likewise.
(reorder_insns_nobb): Likewise.
(emit_insn_after_1): Likewise.
* final.c (rest_of_clean_state): Likewise.
(final_scan_insn): Likewise.
* gcse.c (can_assign_to_reg_without_clobbers_p): Likewise.
* haifa-sched.c (concat_note_lists): Likewise.
(remove_notes): Likewise.
(restore_other_notes): Likewise.
(move_insn): Likewise.
(unlink_bb_notes): Likewise.
(restore_bb_notes): Likewise.
* jump.c (delete_for_peephole): Likewise.
* optabs.c (emit_libcall_block_1): Likewise.
* reorg.c (emit_delay_sequence): Likewise.
(fill_simple_delay_slots): Likewise.
* sel-sched-ir.c (sel_move_insn): Likewise.
(sel_remove_insn): Likewise.
(get_bb_note_from_pool): Likewise.
* sel-sched.c (move_nop_to_previous_block): Likewise.
* config/bfin/bfin.c (reorder_var_tracking_notes): Likewise.
* config/c6x/c6x.c (gen_one_bundle): Likewise.
(c6x_gen_bundles): Likewise.
(hwloop_optimize): Likewise.
* config/frv/frv.c (frv_function_prologue): Likewise.
(frv_register_nop): Likewise.
* config/ia64/ia64.c (ia64_init_dfa_pre_cycle_insn): Likewise.
(ia64_reorg): Likewise.
* config/mep/mep.c (mep_reorg_addcombine): Likewise.
(mep_make_bundle): Likewise.
(mep_bundle_insns): Likewise.
* config/picochip/picochip.c (reorder_var_tracking_notes): Likewise.
* config/tilegx/tilegx.c (reorder_var_tracking_notes): Likewise.
* config/tilepro/tilepro.c (reorder_var_tracking_notes): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214128 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 54 | ||||
-rw-r--r-- | gcc/caller-save.c | 12 | ||||
-rw-r--r-- | gcc/cfgrtl.c | 76 | ||||
-rw-r--r-- | gcc/combine.c | 4 | ||||
-rw-r--r-- | gcc/config/bfin/bfin.c | 14 | ||||
-rw-r--r-- | gcc/config/c6x/c6x.c | 42 | ||||
-rw-r--r-- | gcc/config/frv/frv.c | 16 | ||||
-rw-r--r-- | gcc/config/ia64/ia64.c | 6 | ||||
-rw-r--r-- | gcc/config/mep/mep.c | 36 | ||||
-rw-r--r-- | gcc/config/picochip/picochip.c | 22 | ||||
-rw-r--r-- | gcc/config/tilegx/tilegx.c | 14 | ||||
-rw-r--r-- | gcc/config/tilepro/tilepro.c | 14 | ||||
-rw-r--r-- | gcc/emit-rtl.c | 48 | ||||
-rw-r--r-- | gcc/final.c | 16 | ||||
-rw-r--r-- | gcc/gcse.c | 2 | ||||
-rw-r--r-- | gcc/haifa-sched.c | 40 | ||||
-rw-r--r-- | gcc/jump.c | 4 | ||||
-rw-r--r-- | gcc/optabs.c | 4 | ||||
-rw-r--r-- | gcc/reorg.c | 8 | ||||
-rw-r--r-- | gcc/rtl.h | 11 | ||||
-rw-r--r-- | gcc/sel-sched-ir.c | 16 | ||||
-rw-r--r-- | gcc/sel-sched.c | 12 |
22 files changed, 266 insertions, 205 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8ccdde2fff0..f2258a74813 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,59 @@ 2014-08-19 David Malcolm <dmalcolm@redhat.com> + * rtl.h (PREV_INSN): Split macro in two: the existing one, + for rvalues, and... + (SET_PREV_INSN): New macro, for use as an lvalue. + (NEXT_INSN, SET_NEXT_INSN): Likewise. + + * caller-save.c (save_call_clobbered_regs): Convert lvalue use of + PREV_INSN/NEXT_INSN into SET_PREV_INSN/SET_NEXT_INSN. + * cfgrtl.c (try_redirect_by_replacing_jump): Likewise. + (fixup_abnormal_edges): Likewise. + (unlink_insn_chain): Likewise. + (fixup_reorder_chain): Likewise. + (cfg_layout_delete_block): Likewise. + (cfg_layout_merge_blocks): Likewise. + * combine.c (update_cfg_for_uncondjump): Likewise. + * emit-rtl.c (link_insn_into_chain): Likewise. + (remove_insn): Likewise. + (delete_insns_since): Likewise. + (reorder_insns_nobb): Likewise. + (emit_insn_after_1): Likewise. + * final.c (rest_of_clean_state): Likewise. + (final_scan_insn): Likewise. + * gcse.c (can_assign_to_reg_without_clobbers_p): Likewise. + * haifa-sched.c (concat_note_lists): Likewise. + (remove_notes): Likewise. + (restore_other_notes): Likewise. + (move_insn): Likewise. + (unlink_bb_notes): Likewise. + (restore_bb_notes): Likewise. + * jump.c (delete_for_peephole): Likewise. + * optabs.c (emit_libcall_block_1): Likewise. + * reorg.c (emit_delay_sequence): Likewise. + (fill_simple_delay_slots): Likewise. + * sel-sched-ir.c (sel_move_insn): Likewise. + (sel_remove_insn): Likewise. + (get_bb_note_from_pool): Likewise. + * sel-sched.c (move_nop_to_previous_block): Likewise. + + * config/bfin/bfin.c (reorder_var_tracking_notes): Likewise. + * config/c6x/c6x.c (gen_one_bundle): Likewise. + (c6x_gen_bundles): Likewise. + (hwloop_optimize): Likewise. + * config/frv/frv.c (frv_function_prologue): Likewise. + (frv_register_nop): Likewise. + * config/ia64/ia64.c (ia64_init_dfa_pre_cycle_insn): Likewise. + (ia64_reorg): Likewise. + * config/mep/mep.c (mep_reorg_addcombine): Likewise. + (mep_make_bundle): Likewise. + (mep_bundle_insns): Likewise. + * config/picochip/picochip.c (reorder_var_tracking_notes): Likewise. + * config/tilegx/tilegx.c (reorder_var_tracking_notes): Likewise. + * config/tilepro/tilepro.c (reorder_var_tracking_notes): Likewise. + +2014-08-19 David Malcolm <dmalcolm@redhat.com> + * basic-block.h (BB_HEAD): Convert to a function. Strengthen the return type from rtx to rtx_insn *. (BB_END): Likewise. diff --git a/gcc/caller-save.c b/gcc/caller-save.c index 41b3f01bbd3..b1ef3a9773f 100644 --- a/gcc/caller-save.c +++ b/gcc/caller-save.c @@ -913,13 +913,13 @@ save_call_clobbered_regs (void) prev = PREV_INSN (ins); if (NOTE_P (ins)) { - NEXT_INSN (prev) = NEXT_INSN (ins); - PREV_INSN (NEXT_INSN (ins)) = prev; - PREV_INSN (ins) = insn; - NEXT_INSN (ins) = NEXT_INSN (insn); - NEXT_INSN (insn) = ins; + SET_NEXT_INSN (prev) = NEXT_INSN (ins); + SET_PREV_INSN (NEXT_INSN (ins)) = prev; + SET_PREV_INSN (ins) = insn; + SET_NEXT_INSN (ins) = NEXT_INSN (insn); + SET_NEXT_INSN (insn) = ins; if (NEXT_INSN (ins)) - PREV_INSN (NEXT_INSN (ins)) = ins; + SET_PREV_INSN (NEXT_INSN (ins)) = ins; if (BB_END (bb) == insn) SET_BB_END (bb) = ins; } diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index 671d5f32767..cb07f0bcf0b 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -1060,11 +1060,11 @@ try_redirect_by_replacing_jump (edge e, basic_block target, bool in_cfglayout) if (BARRIER_P (insn)) { if (PREV_INSN (insn)) - NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn); + SET_NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn); else SET_BB_FOOTER (src) = NEXT_INSN (insn); if (NEXT_INSN (insn)) - PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn); + SET_PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn); } if (LABEL_P (insn)) break; @@ -1132,14 +1132,14 @@ try_redirect_by_replacing_jump (edge e, basic_block target, bool in_cfglayout) update_bb_for_insn_chain (NEXT_INSN (BB_END (src)), PREV_INSN (barrier), src); - NEXT_INSN (PREV_INSN (new_insn)) = NEXT_INSN (new_insn); - PREV_INSN (NEXT_INSN (new_insn)) = PREV_INSN (new_insn); + SET_NEXT_INSN (PREV_INSN (new_insn)) = NEXT_INSN (new_insn); + SET_PREV_INSN (NEXT_INSN (new_insn)) = PREV_INSN (new_insn); - NEXT_INSN (new_insn) = barrier; - NEXT_INSN (PREV_INSN (barrier)) = new_insn; + SET_NEXT_INSN (new_insn) = barrier; + SET_NEXT_INSN (PREV_INSN (barrier)) = new_insn; - PREV_INSN (new_insn) = PREV_INSN (barrier); - PREV_INSN (barrier) = new_insn; + SET_PREV_INSN (new_insn) = PREV_INSN (barrier); + SET_PREV_INSN (barrier) = new_insn; } } } @@ -3270,8 +3270,8 @@ fixup_abnormal_edges (void) { /* We're not deleting it, we're moving it. */ INSN_DELETED_P (insn) = 0; - PREV_INSN (insn) = NULL_RTX; - NEXT_INSN (insn) = NULL_RTX; + SET_PREV_INSN (insn) = NULL_RTX; + SET_NEXT_INSN (insn) = NULL_RTX; insert_insn_on_edge (insn, e); inserted = true; @@ -3302,12 +3302,12 @@ unlink_insn_chain (rtx first, rtx last) rtx prevfirst = PREV_INSN (first); rtx nextlast = NEXT_INSN (last); - PREV_INSN (first) = NULL; - NEXT_INSN (last) = NULL; + SET_PREV_INSN (first) = NULL; + SET_NEXT_INSN (last) = NULL; if (prevfirst) - NEXT_INSN (prevfirst) = nextlast; + SET_NEXT_INSN (prevfirst) = nextlast; if (nextlast) - PREV_INSN (nextlast) = prevfirst; + SET_PREV_INSN (nextlast) = prevfirst; else set_last_insn (prevfirst); if (!prevfirst) @@ -3650,32 +3650,32 @@ fixup_reorder_chain (void) if (BB_HEADER (bb)) { if (insn) - NEXT_INSN (insn) = BB_HEADER (bb); + SET_NEXT_INSN (insn) = BB_HEADER (bb); else set_first_insn (BB_HEADER (bb)); - PREV_INSN (BB_HEADER (bb)) = insn; + SET_PREV_INSN (BB_HEADER (bb)) = insn; insn = BB_HEADER (bb); while (NEXT_INSN (insn)) insn = NEXT_INSN (insn); } if (insn) - NEXT_INSN (insn) = BB_HEAD (bb); + SET_NEXT_INSN (insn) = BB_HEAD (bb); else set_first_insn (BB_HEAD (bb)); - PREV_INSN (BB_HEAD (bb)) = insn; + SET_PREV_INSN (BB_HEAD (bb)) = insn; insn = BB_END (bb); if (BB_FOOTER (bb)) { - NEXT_INSN (insn) = BB_FOOTER (bb); - PREV_INSN (BB_FOOTER (bb)) = insn; + SET_NEXT_INSN (insn) = BB_FOOTER (bb); + SET_PREV_INSN (BB_FOOTER (bb)) = insn; while (NEXT_INSN (insn)) insn = NEXT_INSN (insn); } } - NEXT_INSN (insn) = cfg_layout_function_footer; + SET_NEXT_INSN (insn) = cfg_layout_function_footer; if (cfg_layout_function_footer) - PREV_INSN (cfg_layout_function_footer) = insn; + SET_PREV_INSN (cfg_layout_function_footer) = insn; while (NEXT_INSN (insn)) insn = NEXT_INSN (insn); @@ -4410,15 +4410,15 @@ cfg_layout_delete_block (basic_block bb) { next = BB_HEAD (bb); if (prev) - NEXT_INSN (prev) = BB_HEADER (bb); + SET_NEXT_INSN (prev) = BB_HEADER (bb); else set_first_insn (BB_HEADER (bb)); - PREV_INSN (BB_HEADER (bb)) = prev; + SET_PREV_INSN (BB_HEADER (bb)) = prev; insn = BB_HEADER (bb); while (NEXT_INSN (insn)) insn = NEXT_INSN (insn); - NEXT_INSN (insn) = next; - PREV_INSN (next) = insn; + SET_NEXT_INSN (insn) = next; + SET_PREV_INSN (next) = insn; } next = NEXT_INSN (BB_END (bb)); if (BB_FOOTER (bb)) @@ -4429,11 +4429,11 @@ cfg_layout_delete_block (basic_block bb) if (BARRIER_P (insn)) { if (PREV_INSN (insn)) - NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn); + SET_NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn); else SET_BB_FOOTER (bb) = NEXT_INSN (insn); if (NEXT_INSN (insn)) - PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn); + SET_PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn); } if (LABEL_P (insn)) break; @@ -4442,13 +4442,13 @@ cfg_layout_delete_block (basic_block bb) if (BB_FOOTER (bb)) { insn = BB_END (bb); - NEXT_INSN (insn) = BB_FOOTER (bb); - PREV_INSN (BB_FOOTER (bb)) = insn; + SET_NEXT_INSN (insn) = BB_FOOTER (bb); + SET_PREV_INSN (BB_FOOTER (bb)) = insn; while (NEXT_INSN (insn)) insn = NEXT_INSN (insn); - NEXT_INSN (insn) = next; + SET_NEXT_INSN (insn) = next; if (next) - PREV_INSN (next) = insn; + SET_PREV_INSN (next) = insn; else set_last_insn (insn); } @@ -4475,9 +4475,9 @@ cfg_layout_delete_block (basic_block bb) insn = remaints; while (NEXT_INSN (insn)) insn = NEXT_INSN (insn); - NEXT_INSN (insn) = *to; + SET_NEXT_INSN (insn) = *to; if (*to) - PREV_INSN (*to) = insn; + SET_PREV_INSN (*to) = insn; *to = remaints; } } @@ -4573,8 +4573,8 @@ cfg_layout_merge_blocks (basic_block a, basic_block b) while (NEXT_INSN (last)) last = NEXT_INSN (last); - NEXT_INSN (last) = BB_FOOTER (b); - PREV_INSN (BB_FOOTER (b)) = last; + SET_NEXT_INSN (last) = BB_FOOTER (b); + SET_PREV_INSN (BB_FOOTER (b)) = last; } SET_BB_FOOTER (b) = NULL; } @@ -4592,8 +4592,8 @@ cfg_layout_merge_blocks (basic_block a, basic_block b) while (NEXT_INSN (last)) last = NEXT_INSN (last); - NEXT_INSN (last) = BB_FOOTER (a); - PREV_INSN (BB_FOOTER (a)) = last; + SET_NEXT_INSN (last) = BB_FOOTER (a); + SET_PREV_INSN (BB_FOOTER (a)) = last; SET_BB_FOOTER (a) = BB_HEADER (b); } SET_BB_HEADER (b) = NULL; diff --git a/gcc/combine.c b/gcc/combine.c index 2fd516edf27..8c82efc207e 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -2420,11 +2420,11 @@ update_cfg_for_uncondjump (rtx insn) if (BARRIER_P (insn)) { if (PREV_INSN (insn)) - NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn); + SET_NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn); else SET_BB_FOOTER (bb) = NEXT_INSN (insn); if (NEXT_INSN (insn)) - PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn); + SET_PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn); } else if (LABEL_P (insn)) break; diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c index 35bbace4c07..5800ad5ae8e 100644 --- a/gcc/config/bfin/bfin.c +++ b/gcc/config/bfin/bfin.c @@ -4058,10 +4058,10 @@ reorder_var_tracking_notes (void) while (queue) { rtx next_queue = PREV_INSN (queue); - PREV_INSN (NEXT_INSN (insn)) = queue; - NEXT_INSN (queue) = NEXT_INSN (insn); - NEXT_INSN (insn) = queue; - PREV_INSN (queue) = insn; + SET_PREV_INSN (NEXT_INSN (insn)) = queue; + SET_NEXT_INSN (queue) = NEXT_INSN (insn); + SET_NEXT_INSN (insn) = queue; + SET_PREV_INSN (queue) = insn; queue = next_queue; } in_bundle = false; @@ -4074,10 +4074,10 @@ reorder_var_tracking_notes (void) if (in_bundle) { rtx prev = PREV_INSN (insn); - PREV_INSN (next) = prev; - NEXT_INSN (prev) = next; + SET_PREV_INSN (next) = prev; + SET_NEXT_INSN (prev) = next; - PREV_INSN (insn) = queue; + SET_PREV_INSN (insn) = queue; queue = insn; } } diff --git a/gcc/config/c6x/c6x.c b/gcc/config/c6x/c6x.c index 90241ea0ae7..889031ac9da 100644 --- a/gcc/config/c6x/c6x.c +++ b/gcc/config/c6x/c6x.c @@ -4599,7 +4599,7 @@ gen_one_bundle (rtx *slot, int n_filled, int real_first) bundle = make_insn_raw (bundle); BLOCK_FOR_INSN (bundle) = BLOCK_FOR_INSN (slot[0]); INSN_LOCATION (bundle) = INSN_LOCATION (slot[0]); - PREV_INSN (bundle) = PREV_INSN (slot[real_first]); + SET_PREV_INSN (bundle) = SET_PREV_INSN (slot[real_first]); t = NULL_RTX; @@ -4607,18 +4607,18 @@ gen_one_bundle (rtx *slot, int n_filled, int real_first) { rtx insn = slot[i]; remove_insn (insn); - PREV_INSN (insn) = t ? t : PREV_INSN (bundle); + SET_PREV_INSN (insn) = t ? t : PREV_INSN (bundle); if (t != NULL_RTX) - NEXT_INSN (t) = insn; + SET_NEXT_INSN (t) = insn; t = insn; if (i > 0) INSN_LOCATION (slot[i]) = INSN_LOCATION (bundle); } - NEXT_INSN (bundle) = NEXT_INSN (PREV_INSN (bundle)); - NEXT_INSN (t) = NEXT_INSN (bundle); - NEXT_INSN (PREV_INSN (bundle)) = bundle; - PREV_INSN (NEXT_INSN (bundle)) = bundle; + SET_NEXT_INSN (bundle) = NEXT_INSN (PREV_INSN (bundle)); + SET_NEXT_INSN (t) = NEXT_INSN (bundle); + SET_NEXT_INSN (PREV_INSN (bundle)) = bundle; + SET_PREV_INSN (NEXT_INSN (bundle)) = bundle; } /* Move all parallel instructions into SEQUENCEs, so that no subsequent passes @@ -4710,12 +4710,12 @@ c6x_gen_bundles (void) continue; if (NEXT_INSN (last_call) == insn) continue; - NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn); - PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn); - PREV_INSN (insn) = last_call; - NEXT_INSN (insn) = NEXT_INSN (last_call); - PREV_INSN (NEXT_INSN (insn)) = insn; - NEXT_INSN (PREV_INSN (insn)) = insn; + SET_NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn); + SET_PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn); + SET_PREV_INSN (insn) = last_call; + SET_NEXT_INSN (insn) = NEXT_INSN (last_call); + SET_PREV_INSN (NEXT_INSN (insn)) = insn; + SET_NEXT_INSN (PREV_INSN (insn)) = insn; last_call = insn; } } @@ -5698,8 +5698,8 @@ hwloop_optimize (hwloop_info loop) reservations of the instructions contained in it to the corresponding instructions from iteration 0, which are the only ones we'll keep. */ assign_reservations (BB_HEAD (bb), ss.last_scheduled_insn); - PREV_INSN (BB_END (bb)) = ss.last_scheduled_iter0; - NEXT_INSN (ss.last_scheduled_iter0) = BB_END (bb); + SET_PREV_INSN (BB_END (bb)) = ss.last_scheduled_iter0; + SET_NEXT_INSN (ss.last_scheduled_iter0) = BB_END (bb); filter_insns_above (bb, sploop_max_uid_iter0); for (i = 0; i < n_real_insns; i++) @@ -5821,13 +5821,13 @@ hwloop_optimize (hwloop_info loop) for (i = 1; i < n_insns; i++) { - NEXT_INSN (orig_vec[i - 1]) = orig_vec[i]; - PREV_INSN (orig_vec[i]) = orig_vec[i - 1]; + SET_NEXT_INSN (orig_vec[i - 1]) = orig_vec[i]; + SET_PREV_INSN (orig_vec[i]) = orig_vec[i - 1]; } - PREV_INSN (orig_vec[0]) = PREV_INSN (BB_HEAD (bb)); - NEXT_INSN (PREV_INSN (BB_HEAD (bb))) = orig_vec[0]; - NEXT_INSN (orig_vec[n_insns - 1]) = NEXT_INSN (BB_END (bb)); - PREV_INSN (NEXT_INSN (BB_END (bb))) = orig_vec[n_insns - 1]; + SET_PREV_INSN (orig_vec[0]) = PREV_INSN (BB_HEAD (bb)); + SET_NEXT_INSN (PREV_INSN (BB_HEAD (bb))) = orig_vec[0]; + SET_NEXT_INSN (orig_vec[n_insns - 1]) = NEXT_INSN (BB_END (bb)); + SET_PREV_INSN (NEXT_INSN (BB_END (bb))) = orig_vec[n_insns - 1]; SET_BB_HEAD (bb) = orig_vec[0]; SET_BB_END (bb) = orig_vec[n_insns - 1]; undo_splits: diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c index d282ef2eb9b..1ed8f74c667 100644 --- a/gcc/config/frv/frv.c +++ b/gcc/config/frv/frv.c @@ -1465,12 +1465,12 @@ frv_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED) if (NEXT_INSN (last_call) == insn) continue; - NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn); - PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn); - PREV_INSN (insn) = last_call; - NEXT_INSN (insn) = NEXT_INSN (last_call); - PREV_INSN (NEXT_INSN (insn)) = insn; - NEXT_INSN (PREV_INSN (insn)) = insn; + SET_NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn); + SET_PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn); + SET_PREV_INSN (insn) = last_call; + SET_NEXT_INSN (insn) = NEXT_INSN (last_call); + SET_PREV_INSN (NEXT_INSN (insn)) = insn; + SET_NEXT_INSN (PREV_INSN (insn)) = insn; last_call = insn; } } @@ -8162,8 +8162,8 @@ static void frv_register_nop (rtx nop) { nop = make_insn_raw (nop); - NEXT_INSN (nop) = 0; - PREV_INSN (nop) = 0; + SET_NEXT_INSN (nop) = 0; + SET_PREV_INSN (nop) = 0; frv_nops[frv_num_nops++] = nop; } diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index ae22bea379e..1b2146d0bbb 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -9489,10 +9489,10 @@ ia64_init_dfa_pre_cycle_insn (void) prev_cycle_state = xmalloc (dfa_state_size); } dfa_pre_cycle_insn = make_insn_raw (gen_pre_cycle ()); - PREV_INSN (dfa_pre_cycle_insn) = NEXT_INSN (dfa_pre_cycle_insn) = NULL_RTX; + SET_PREV_INSN (dfa_pre_cycle_insn) = SET_NEXT_INSN (dfa_pre_cycle_insn) = NULL_RTX; recog_memoized (dfa_pre_cycle_insn); dfa_stop_insn = make_insn_raw (gen_insn_group_barrier (GEN_INT (3))); - PREV_INSN (dfa_stop_insn) = NEXT_INSN (dfa_stop_insn) = NULL_RTX; + SET_PREV_INSN (dfa_stop_insn) = SET_NEXT_INSN (dfa_stop_insn) = NULL_RTX; recog_memoized (dfa_stop_insn); } @@ -9679,7 +9679,7 @@ ia64_reorg (void) initiate_bundle_states (); ia64_nop = make_insn_raw (gen_nop ()); - PREV_INSN (ia64_nop) = NEXT_INSN (ia64_nop) = NULL_RTX; + SET_PREV_INSN (ia64_nop) = SET_NEXT_INSN (ia64_nop) = NULL_RTX; recog_memoized (ia64_nop); clocks_length = get_max_uid () + 1; stops_p = XCNEWVEC (char, clocks_length); diff --git a/gcc/config/mep/mep.c b/gcc/config/mep/mep.c index dadd92bab21..abd8e5cd3ce 100644 --- a/gcc/config/mep/mep.c +++ b/gcc/config/mep/mep.c @@ -5695,9 +5695,9 @@ mep_reorg_addcombine (rtx insns) && ic + nc > -32768) { XEXP (SET_SRC (PATTERN (i)), 1) = GEN_INT (ic + nc); - NEXT_INSN (i) = NEXT_INSN (n); + SET_NEXT_INSN (i) = NEXT_INSN (n); if (NEXT_INSN (i)) - PREV_INSN (NEXT_INSN (i)) = i; + SET_PREV_INSN (NEXT_INSN (i)) = i; } } } @@ -6812,10 +6812,10 @@ mep_make_bundle (rtx core, rtx cop) remove_insn (cop); /* Set up the links of the insns inside the SEQUENCE. */ - PREV_INSN (core) = PREV_INSN (insn); - NEXT_INSN (core) = cop; - PREV_INSN (cop) = core; - NEXT_INSN (cop) = NEXT_INSN (insn); + SET_PREV_INSN (core) = PREV_INSN (insn); + SET_NEXT_INSN (core) = cop; + SET_PREV_INSN (cop) = core; + SET_NEXT_INSN (cop) = NEXT_INSN (insn); /* Set the VLIW flag for the coprocessor instruction. */ PUT_MODE (core, VOIDmode); @@ -6933,13 +6933,13 @@ mep_bundle_insns (rtx insns) if (NOTE_P (note)) { /* Remove NOTE from here... */ - PREV_INSN (NEXT_INSN (note)) = PREV_INSN (note); - NEXT_INSN (PREV_INSN (note)) = NEXT_INSN (note); + SET_PREV_INSN (NEXT_INSN (note)) = PREV_INSN (note); + SET_NEXT_INSN (PREV_INSN (note)) = NEXT_INSN (note); /* ...and put it in here. */ - NEXT_INSN (note) = first; - PREV_INSN (note) = PREV_INSN (first); - NEXT_INSN (PREV_INSN (note)) = note; - PREV_INSN (NEXT_INSN (note)) = note; + SET_NEXT_INSN (note) = first; + SET_PREV_INSN (note) = PREV_INSN (first); + SET_NEXT_INSN (PREV_INSN (note)) = note; + SET_PREV_INSN (NEXT_INSN (note)) = note; } note = prev; @@ -7001,17 +7001,17 @@ mep_bundle_insns (rtx insns) /* Remove core insn. */ if (PREV_INSN (core_insn)) - NEXT_INSN (PREV_INSN (core_insn)) = NEXT_INSN (core_insn); + SET_NEXT_INSN (PREV_INSN (core_insn)) = NEXT_INSN (core_insn); if (NEXT_INSN (core_insn)) - PREV_INSN (NEXT_INSN (core_insn)) = PREV_INSN (core_insn); + SET_PREV_INSN (NEXT_INSN (core_insn)) = PREV_INSN (core_insn); /* Re-insert core insn. */ - PREV_INSN (core_insn) = PREV_INSN (insn); - NEXT_INSN (core_insn) = insn; + SET_PREV_INSN (core_insn) = PREV_INSN (insn); + SET_NEXT_INSN (core_insn) = insn; if (PREV_INSN (core_insn)) - NEXT_INSN (PREV_INSN (core_insn)) = core_insn; - PREV_INSN (insn) = core_insn; + SET_NEXT_INSN (PREV_INSN (core_insn)) = core_insn; + SET_PREV_INSN (insn) = core_insn; PUT_MODE (core_insn, TImode); PUT_MODE (insn, VOIDmode); diff --git a/gcc/config/picochip/picochip.c b/gcc/config/picochip/picochip.c index 6433acb49d5..1894fadf9ce 100644 --- a/gcc/config/picochip/picochip.c +++ b/gcc/config/picochip/picochip.c @@ -3199,10 +3199,10 @@ reorder_var_tracking_notes (void) while (queue) { rtx next_queue = PREV_INSN (queue); - PREV_INSN (NEXT_INSN(insn)) = queue; - NEXT_INSN(queue) = NEXT_INSN(insn); - PREV_INSN(queue) = insn; - NEXT_INSN(insn) = queue; + SET_PREV_INSN (NEXT_INSN(insn)) = queue; + SET_NEXT_INSN(queue) = NEXT_INSN(insn); + SET_PREV_INSN(queue) = insn; + SET_NEXT_INSN(insn) = queue; queue = next_queue; } /* There is no more to do for this bb. break*/ @@ -3216,10 +3216,10 @@ reorder_var_tracking_notes (void) while (queue) { rtx next_queue = PREV_INSN (queue); - NEXT_INSN (PREV_INSN(insn)) = queue; - PREV_INSN (queue) = PREV_INSN(insn); - PREV_INSN (insn) = queue; - NEXT_INSN (queue) = insn; + SET_NEXT_INSN (PREV_INSN(insn)) = queue; + SET_PREV_INSN (queue) = PREV_INSN(insn); + SET_PREV_INSN (insn) = queue; + SET_NEXT_INSN (queue) = insn; queue = next_queue; } } @@ -3227,15 +3227,15 @@ reorder_var_tracking_notes (void) else if (NOTE_P (insn)) { rtx prev = PREV_INSN (insn); - PREV_INSN (next) = prev; - NEXT_INSN (prev) = next; + SET_PREV_INSN (next) = prev; + SET_NEXT_INSN (prev) = next; /* Ignore call_arg notes. They are expected to be just after the call insn. If the call is start of a long VLIW, labels are emitted in the middle of a VLIW, which our assembler can not handle. */ if (NOTE_KIND (insn) != NOTE_INSN_CALL_ARG_LOCATION) { - PREV_INSN (insn) = queue; + SET_PREV_INSN (insn) = queue; queue = insn; } } diff --git a/gcc/config/tilegx/tilegx.c b/gcc/config/tilegx/tilegx.c index 69c9be4f9b6..ebdcb7bf09f 100644 --- a/gcc/config/tilegx/tilegx.c +++ b/gcc/config/tilegx/tilegx.c @@ -4827,10 +4827,10 @@ reorder_var_tracking_notes (void) while (queue) { rtx next_queue = PREV_INSN (queue); - PREV_INSN (NEXT_INSN (insn)) = queue; - NEXT_INSN (queue) = NEXT_INSN (insn); - NEXT_INSN (insn) = queue; - PREV_INSN (queue) = insn; + SET_PREV_INSN (NEXT_INSN (insn)) = queue; + SET_NEXT_INSN (queue) = NEXT_INSN (insn); + SET_NEXT_INSN (insn) = queue; + SET_PREV_INSN (queue) = insn; queue = next_queue; } in_bundle = false; @@ -4843,10 +4843,10 @@ reorder_var_tracking_notes (void) if (in_bundle) { rtx prev = PREV_INSN (insn); - PREV_INSN (next) = prev; - NEXT_INSN (prev) = next; + SET_PREV_INSN (next) = prev; + SET_NEXT_INSN (prev) = next; - PREV_INSN (insn) = queue; + SET_PREV_INSN (insn) = queue; queue = insn; } } diff --git a/gcc/config/tilepro/tilepro.c b/gcc/config/tilepro/tilepro.c index d36c0659969..c27aca949ec 100644 --- a/gcc/config/tilepro/tilepro.c +++ b/gcc/config/tilepro/tilepro.c @@ -4283,10 +4283,10 @@ reorder_var_tracking_notes (void) while (queue) { rtx next_queue = PREV_INSN (queue); - PREV_INSN (NEXT_INSN (insn)) = queue; - NEXT_INSN (queue) = NEXT_INSN (insn); - NEXT_INSN (insn) = queue; - PREV_INSN (queue) = insn; + SET_PREV_INSN (NEXT_INSN (insn)) = queue; + SET_NEXT_INSN (queue) = NEXT_INSN (insn); + SET_NEXT_INSN (insn) = queue; + SET_PREV_INSN (queue) = insn; queue = next_queue; } in_bundle = false; @@ -4299,10 +4299,10 @@ reorder_var_tracking_notes (void) if (in_bundle) { rtx prev = PREV_INSN (insn); - PREV_INSN (next) = prev; - NEXT_INSN (prev) = next; + SET_PREV_INSN (next) = prev; + SET_NEXT_INSN (prev) = next; - PREV_INSN (insn) = queue; + SET_PREV_INSN (insn) = queue; queue = insn; } } diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 56aad90ab72..0b537d02cd9 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -3874,29 +3874,29 @@ make_note_raw (enum insn_note subtype) static inline void link_insn_into_chain (rtx insn, rtx prev, rtx next) { - PREV_INSN (insn) = prev; - NEXT_INSN (insn) = next; + SET_PREV_INSN (insn) = prev; + SET_NEXT_INSN (insn) = next; if (prev != NULL) { - NEXT_INSN (prev) = insn; + SET_NEXT_INSN (prev) = insn; if (NONJUMP_INSN_P (prev) && GET_CODE (PATTERN (prev)) == SEQUENCE) { rtx sequence = PATTERN (prev); - NEXT_INSN (XVECEXP (sequence, 0, XVECLEN (sequence, 0) - 1)) = insn; + SET_NEXT_INSN (XVECEXP (sequence, 0, XVECLEN (sequence, 0) - 1)) = insn; } } if (next != NULL) { - PREV_INSN (next) = insn; + SET_PREV_INSN (next) = insn; if (NONJUMP_INSN_P (next) && GET_CODE (PATTERN (next)) == SEQUENCE) - PREV_INSN (XVECEXP (PATTERN (next), 0, 0)) = insn; + SET_PREV_INSN (XVECEXP (PATTERN (next), 0, 0)) = insn; } if (NONJUMP_INSN_P (insn) && GET_CODE (PATTERN (insn)) == SEQUENCE) { rtx sequence = PATTERN (insn); - PREV_INSN (XVECEXP (sequence, 0, 0)) = prev; - NEXT_INSN (XVECEXP (sequence, 0, XVECLEN (sequence, 0) - 1)) = next; + SET_PREV_INSN (XVECEXP (sequence, 0, 0)) = prev; + SET_NEXT_INSN (XVECEXP (sequence, 0, XVECLEN (sequence, 0) - 1)) = next; } } @@ -4068,17 +4068,17 @@ remove_insn (rtx insn) if (prev) { - NEXT_INSN (prev) = next; + SET_NEXT_INSN (prev) = next; if (NONJUMP_INSN_P (prev) && GET_CODE (PATTERN (prev)) == SEQUENCE) { rtx sequence = PATTERN (prev); - NEXT_INSN (XVECEXP (sequence, 0, XVECLEN (sequence, 0) - 1)) = next; + SET_NEXT_INSN (XVECEXP (sequence, 0, XVECLEN (sequence, 0) - 1)) = next; } } else if (get_insns () == insn) { if (next) - PREV_INSN (next) = NULL; + SET_PREV_INSN (next) = NULL; set_first_insn (next); } else @@ -4097,9 +4097,9 @@ remove_insn (rtx insn) if (next) { - PREV_INSN (next) = prev; + SET_PREV_INSN (next) = prev; if (NONJUMP_INSN_P (next) && GET_CODE (PATTERN (next)) == SEQUENCE) - PREV_INSN (XVECEXP (PATTERN (next), 0, 0)) = prev; + SET_PREV_INSN (XVECEXP (PATTERN (next), 0, 0)) = prev; } else if (get_last_insn () == insn) set_last_insn (prev); @@ -4165,7 +4165,7 @@ delete_insns_since (rtx from) if (from == 0) set_first_insn (0); else - NEXT_INSN (from) = 0; + SET_NEXT_INSN (from) = 0; set_last_insn (from); } @@ -4191,9 +4191,9 @@ reorder_insns_nobb (rtx from, rtx to, rtx after) /* Splice this bunch out of where it is now. */ if (PREV_INSN (from)) - NEXT_INSN (PREV_INSN (from)) = NEXT_INSN (to); + SET_NEXT_INSN (PREV_INSN (from)) = NEXT_INSN (to); if (NEXT_INSN (to)) - PREV_INSN (NEXT_INSN (to)) = PREV_INSN (from); + SET_PREV_INSN (NEXT_INSN (to)) = PREV_INSN (from); if (get_last_insn () == to) set_last_insn (PREV_INSN (from)); if (get_insns () == from) @@ -4201,11 +4201,11 @@ reorder_insns_nobb (rtx from, rtx to, rtx after) /* Make the new neighbors point to it and it to them. */ if (NEXT_INSN (after)) - PREV_INSN (NEXT_INSN (after)) = to; + SET_PREV_INSN (NEXT_INSN (after)) = to; - NEXT_INSN (to) = NEXT_INSN (after); - PREV_INSN (from) = after; - NEXT_INSN (after) = from; + SET_NEXT_INSN (to) = NEXT_INSN (after); + SET_PREV_INSN (from) = after; + SET_NEXT_INSN (after) = from; if (after == get_last_insn ()) set_last_insn (to); } @@ -4410,11 +4410,11 @@ emit_insn_after_1 (rtx first, rtx after, basic_block bb) after_after = NEXT_INSN (after); - NEXT_INSN (after) = first; - PREV_INSN (first) = after; - NEXT_INSN (last) = after_after; + SET_NEXT_INSN (after) = first; + SET_PREV_INSN (first) = after; + SET_NEXT_INSN (last) = after_after; if (after_after) - PREV_INSN (after_after) = last; + SET_PREV_INSN (after_after) = last; if (after == get_last_insn ()) set_last_insn (last); diff --git a/gcc/final.c b/gcc/final.c index 304ae2ab6ee..6cfc0b94a5a 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -2856,12 +2856,12 @@ final_scan_insn (rtx insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED, when generating a far jump in a delayed branch sequence. */ note = NEXT_INSN (insn); - PREV_INSN (note) = prev; - NEXT_INSN (prev) = note; - NEXT_INSN (PREV_INSN (next)) = insn; - PREV_INSN (insn) = PREV_INSN (next); - NEXT_INSN (insn) = next; - PREV_INSN (next) = insn; + SET_PREV_INSN (note) = prev; + SET_NEXT_INSN (prev) = note; + SET_NEXT_INSN (PREV_INSN (next)) = insn; + SET_PREV_INSN (insn) = PREV_INSN (next); + SET_NEXT_INSN (insn) = next; + SET_PREV_INSN (next) = insn; } /* PEEPHOLE might have changed this. */ @@ -4628,8 +4628,8 @@ rest_of_clean_state (void) for (insn = get_insns (); insn; insn = next) { next = NEXT_INSN (insn); - NEXT_INSN (insn) = NULL; - PREV_INSN (insn) = NULL; + SET_NEXT_INSN (insn) = NULL; + SET_PREV_INSN (insn) = NULL; if (final_output && (!NOTE_P (insn) || diff --git a/gcc/gcse.c b/gcc/gcse.c index 7f1eb8fead3..406a3ec1106 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -866,7 +866,7 @@ can_assign_to_reg_without_clobbers_p (rtx x) gen_rtx_REG (word_mode, FIRST_PSEUDO_REGISTER * 2), const0_rtx)); - NEXT_INSN (test_insn) = PREV_INSN (test_insn) = 0; + SET_NEXT_INSN (test_insn) = SET_PREV_INSN (test_insn) = 0; INSN_LOCATION (test_insn) = UNKNOWN_LOCATION; } diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c index 69002af56c2..32b1adf5bd9 100644 --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -4024,8 +4024,8 @@ concat_note_lists (rtx from_end, rtx *to_endp) while (PREV_INSN (from_start) != NULL) from_start = PREV_INSN (from_start); - PREV_INSN (from_start) = *to_endp; - NEXT_INSN (*to_endp) = from_start; + SET_PREV_INSN (from_start) = *to_endp; + SET_NEXT_INSN (*to_endp) = from_start; *to_endp = from_end; } @@ -4066,10 +4066,10 @@ remove_notes (rtx head, rtx tail) remove_insn (insn); /* Add the note to list that ends at NOTE_LIST. */ - PREV_INSN (insn) = note_list; - NEXT_INSN (insn) = NULL_RTX; + SET_PREV_INSN (insn) = note_list; + SET_NEXT_INSN (insn) = NULL_RTX; if (note_list) - NEXT_INSN (note_list) = insn; + SET_NEXT_INSN (note_list) = insn; note_list = insn; break; } @@ -4862,10 +4862,10 @@ restore_other_notes (rtx head, basic_block head_bb) /* In the above cycle we've missed this note. */ set_block_for_insn (note_head, head_bb); - PREV_INSN (note_head) = PREV_INSN (head); - NEXT_INSN (PREV_INSN (head)) = note_head; - PREV_INSN (head) = note_list; - NEXT_INSN (note_list) = head; + SET_PREV_INSN (note_head) = PREV_INSN (head); + SET_NEXT_INSN (PREV_INSN (head)) = note_head; + SET_PREV_INSN (head) = note_list; + SET_NEXT_INSN (note_list) = head; if (BLOCK_FOR_INSN (head) != head_bb) SET_BB_END (head_bb) = note_list; @@ -5291,14 +5291,14 @@ move_insn (rtx insn, rtx last, rtx nt) else note = insn; - NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (note); - PREV_INSN (NEXT_INSN (note)) = PREV_INSN (insn); + SET_NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (note); + SET_PREV_INSN (NEXT_INSN (note)) = PREV_INSN (insn); - NEXT_INSN (note) = NEXT_INSN (last); - PREV_INSN (NEXT_INSN (last)) = note; + SET_NEXT_INSN (note) = NEXT_INSN (last); + SET_PREV_INSN (NEXT_INSN (last)) = note; - NEXT_INSN (last) = insn; - PREV_INSN (insn) = last; + SET_NEXT_INSN (last) = insn; + SET_PREV_INSN (insn) = last; bb = BLOCK_FOR_INSN (last); @@ -8227,8 +8227,8 @@ unlink_bb_notes (basic_block first, basic_block last) next = NEXT_INSN (note); gcc_assert (prev && next); - NEXT_INSN (prev) = next; - PREV_INSN (next) = prev; + SET_NEXT_INSN (prev) = next; + SET_PREV_INSN (next) = prev; bb_header[last->index] = label; @@ -8269,9 +8269,9 @@ restore_bb_notes (basic_block first) bb_header[first->index] = 0; - NEXT_INSN (prev) = label; - NEXT_INSN (note) = next; - PREV_INSN (next) = note; + SET_NEXT_INSN (prev) = label; + SET_NEXT_INSN (note) = next; + SET_PREV_INSN (next) = note; first = first->next_bb; } diff --git a/gcc/jump.c b/gcc/jump.c index 637ecaea3ae..87091a36e05 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -1414,10 +1414,10 @@ delete_for_peephole (rtx from, rtx to) /* We don't do this all at once, because we must preserve all NOTEs. */ if (prev) - NEXT_INSN (prev) = next; + SET_NEXT_INSN (prev) = next; if (next) - PREV_INSN (next) = prev; + SET_PREV_INSN (next) = prev; } if (insn == to) diff --git a/gcc/optabs.c b/gcc/optabs.c index d6412ec42d7..60228d3bcd1 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -3959,12 +3959,12 @@ emit_libcall_block_1 (rtx insns, rtx target, rtx result, rtx equiv, if (! data.must_stay) { if (PREV_INSN (insn)) - NEXT_INSN (PREV_INSN (insn)) = next; + SET_NEXT_INSN (PREV_INSN (insn)) = next; else insns = next; if (next) - PREV_INSN (next) = PREV_INSN (insn); + SET_PREV_INSN (next) = PREV_INSN (insn); add_insn (insn); } diff --git a/gcc/reorg.c b/gcc/reorg.c index 242d7754f3e..18908457ecd 100644 --- a/gcc/reorg.c +++ b/gcc/reorg.c @@ -516,7 +516,7 @@ emit_delay_sequence (rtx insn, rtx list, int length) the SEQUENCE. Remember where we want to emit SEQUENCE in AFTER. */ rtx after = PREV_INSN (insn); remove_insn (insn); - NEXT_INSN (insn) = PREV_INSN (insn) = NULL; + SET_NEXT_INSN (insn) = SET_PREV_INSN (insn) = NULL; /* Build our SEQUENCE and rebuild the insn chain. */ int i = 1; @@ -532,7 +532,7 @@ emit_delay_sequence (rtx insn, rtx list, int length) /* Unlink insn from its original place, and re-emit it into the sequence. */ - NEXT_INSN (tem) = PREV_INSN (tem) = NULL; + SET_NEXT_INSN (tem) = SET_PREV_INSN (tem) = NULL; XVECEXP (seq, 0, i) = emit_insn (tem); /* SPARC assembler, for instance, emit warning when debug info is output @@ -2015,9 +2015,9 @@ fill_simple_delay_slots (int non_jumps_p) rtx next = NEXT_INSN (trial); rtx prev = PREV_INSN (trial); if (prev) - NEXT_INSN (prev) = next; + SET_NEXT_INSN (prev) = next; if (next) - PREV_INSN (next) = prev; + SET_PREV_INSN (next) = prev; } } diff --git a/gcc/rtl.h b/gcc/rtl.h index 3c6e9a35b4f..93bce91f4fc 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -972,8 +972,15 @@ extern void rtl_check_failed_flag (const char *, const_rtx, const char *, (RTL_INSN_CHAIN_FLAG_CHECK ("INSN_UID", (INSN))->u2.insn_uid) /* Chain insns together in sequence. */ -#define PREV_INSN(INSN) XEXP (INSN, 0) -#define NEXT_INSN(INSN) XEXP (INSN, 1) +/* For now these are split in two: an rvalue form: + PREV_INSN/NEXT_INSN + and an lvalue form: + SET_NEXT_INSN/SET_PREV_INSN. */ + +#define PREV_INSN(INSN) XEXP ((const_rtx)(INSN), 0) +#define SET_PREV_INSN(INSN) XEXP (INSN, 0) +#define NEXT_INSN(INSN) XEXP ((const_rtx)(INSN), 1) +#define SET_NEXT_INSN(INSN) XEXP (INSN, 1) #define BLOCK_FOR_INSN(INSN) XBBDEF (INSN, 2) diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c index 8411d6f66cc..06245206728 100644 --- a/gcc/sel-sched-ir.c +++ b/gcc/sel-sched-ir.c @@ -1423,11 +1423,11 @@ sel_move_insn (expr_t expr, int seqno, insn_t after) /* Assert that in move_op we disconnected this insn properly. */ gcc_assert (EXPR_VINSN (INSN_EXPR (insn)) != NULL); - PREV_INSN (insn) = after; - NEXT_INSN (insn) = next; + SET_PREV_INSN (insn) = after; + SET_NEXT_INSN (insn) = next; - NEXT_INSN (after) = insn; - PREV_INSN (next) = insn; + SET_NEXT_INSN (after) = insn; + SET_PREV_INSN (next) = insn; /* Update links from insn to bb and vice versa. */ df_insn_change_bb (insn, bb); @@ -3942,8 +3942,8 @@ sel_remove_insn (insn_t insn, bool only_disconnect, bool full_tidying) /* It is necessary to NULL these fields in case we are going to re-insert INSN into the insns stream, as will usually happen in the ONLY_DISCONNECT case, but also for NOPs that we will return to the nop pool. */ - PREV_INSN (insn) = NULL_RTX; - NEXT_INSN (insn) = NULL_RTX; + SET_PREV_INSN (insn) = NULL_RTX; + SET_NEXT_INSN (insn) = NULL_RTX; set_block_for_insn (insn, NULL); return tidy_control_flow (bb, full_tidying); @@ -4985,8 +4985,8 @@ get_bb_note_from_pool (void) { rtx note = bb_note_pool.pop (); - PREV_INSN (note) = NULL_RTX; - NEXT_INSN (note) = NULL_RTX; + SET_PREV_INSN (note) = NULL_RTX; + SET_NEXT_INSN (note) = NULL_RTX; return note; } diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c index 60a077c23ea..7b3c43303b7 100644 --- a/gcc/sel-sched.c +++ b/gcc/sel-sched.c @@ -5193,14 +5193,14 @@ move_nop_to_previous_block (insn_t nop, basic_block prev_bb) gcc_assert (prev_insn != NULL_RTX && PREV_INSN (note) == prev_insn); - NEXT_INSN (prev_insn) = nop; - PREV_INSN (nop) = prev_insn; + SET_NEXT_INSN (prev_insn) = nop; + SET_PREV_INSN (nop) = prev_insn; - PREV_INSN (note) = nop; - NEXT_INSN (note) = next_insn; + SET_PREV_INSN (note) = nop; + SET_NEXT_INSN (note) = next_insn; - NEXT_INSN (nop) = note; - PREV_INSN (next_insn) = note; + SET_NEXT_INSN (nop) = note; + SET_PREV_INSN (next_insn) = note; SET_BB_END (prev_bb) = nop; BLOCK_FOR_INSN (nop) = prev_bb; |