From 5d911cafe95879bb3d1442a2fd6affbba1e9c279 Mon Sep 17 00:00:00 2001 From: Trevor Saunders Date: Sun, 24 Apr 2016 08:45:13 +0000 Subject: [PATCH] stop using rtx_insn_list in reorg.c gcc/ChangeLog: 2016-04-24 Trevor Saunders * reorg.c (try_merge_delay_insns): Make merged_insns a vector. From-SVN: r235393 --- gcc/ChangeLog | 4 ++++ gcc/reorg.c | 23 +++++++++++------------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a820a0f9f7b..8cfccea95ef 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2016-04-24 Trevor Saunders + + * reorg.c (try_merge_delay_insns): Make merged_insns a vector. + 2016-04-24 Trevor Saunders * vec.h (vec_safe_contains): New function. diff --git a/gcc/reorg.c b/gcc/reorg.c index 7b28821c99f..8fb912a0f92 100644 --- a/gcc/reorg.c +++ b/gcc/reorg.c @@ -1259,7 +1259,7 @@ try_merge_delay_insns (rtx_insn *insn, rtx_insn *thread) int num_slots = XVECLEN (PATTERN (insn), 0); rtx next_to_match = XVECEXP (PATTERN (insn), 0, slot_number); struct resources set, needed, modified; - rtx_insn_list *merged_insns = 0; + auto_vec, 10> merged_insns; int i, j; int flags; @@ -1319,7 +1319,7 @@ try_merge_delay_insns (rtx_insn *insn, rtx_insn *thread) INSN_FROM_TARGET_P (next_to_match) = 0; } else - merged_insns = gen_rtx_INSN_LIST (VOIDmode, trial, merged_insns); + merged_insns.safe_push (std::pair (trial, false)); if (++slot_number == num_slots) break; @@ -1384,8 +1384,8 @@ try_merge_delay_insns (rtx_insn *insn, rtx_insn *thread) INSN_FROM_TARGET_P (next_to_match) = 0; } else - merged_insns = gen_rtx_INSN_LIST (SImode, dtrial, - merged_insns); + merged_insns.safe_push (std::pair (dtrial, + true)); if (++slot_number == num_slots) break; @@ -1409,21 +1409,20 @@ try_merge_delay_insns (rtx_insn *insn, rtx_insn *thread) target. */ if (slot_number == num_slots && annul_p) { - for (; merged_insns; merged_insns = merged_insns->next ()) + unsigned int len = merged_insns.length (); + for (unsigned int i = len - 1; i < len; i--) { - if (GET_MODE (merged_insns) == SImode) + if (merged_insns[i].second) { - rtx_insn *new_rtx; - - update_block (merged_insns->insn (), thread); - new_rtx = delete_from_delay_slot (merged_insns->insn ()); + update_block (merged_insns[i].first, thread); + rtx_insn *new_rtx = delete_from_delay_slot (merged_insns[i].first); if (thread->deleted ()) thread = new_rtx; } else { - update_block (merged_insns->insn (), thread); - delete_related_insns (merged_insns->insn ()); + update_block (merged_insns[i].first, thread); + delete_related_insns (merged_insns[i].first); } }