diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-04-26 22:32:05 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-04-26 22:32:05 +0200 |
commit | 5e851c020abe8d78f73ace4ff8a3a2e047662865 (patch) | |
tree | 1e7bd78305573f11df0397525a78334fa82dec89 /gcc/reorg.c | |
parent | ca1206be9a340b874a1f6e47f9028c22dda5a9f9 (diff) | |
download | gcc-5e851c020abe8d78f73ace4ff8a3a2e047662865.zip gcc-5e851c020abe8d78f73ace4ff8a3a2e047662865.tar.gz gcc-5e851c020abe8d78f73ace4ff8a3a2e047662865.tar.bz2 |
reorg.c (try_merge_delay_insns): Declare i and j inside the for loops rather than one for the whole function.
* reorg.c (try_merge_delay_insns): Declare i and j inside the
for loops rather than one for the whole function.
From-SVN: r235451
Diffstat (limited to 'gcc/reorg.c')
-rw-r--r-- | gcc/reorg.c | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/gcc/reorg.c b/gcc/reorg.c index 8fb912a..c58d608 100644 --- a/gcc/reorg.c +++ b/gcc/reorg.c @@ -1260,7 +1260,6 @@ try_merge_delay_insns (rtx_insn *insn, rtx_insn *thread) rtx next_to_match = XVECEXP (PATTERN (insn), 0, slot_number); struct resources set, needed, modified; auto_vec<std::pair<rtx_insn *, bool>, 10> merged_insns; - int i, j; int flags; flags = get_jump_flags (delay_insn, JUMP_LABEL (delay_insn)); @@ -1275,7 +1274,7 @@ try_merge_delay_insns (rtx_insn *insn, rtx_insn *thread) will essentially disable this optimization. This method is somewhat of a kludge, but I don't see a better way.) */ if (! annul_p) - for (i = 1 ; i < num_slots; i++) + for (int i = 1; i < num_slots; i++) if (XVECEXP (PATTERN (insn), 0, i)) mark_referenced_resources (XVECEXP (PATTERN (insn), 0, i), &needed, true); @@ -1346,19 +1345,19 @@ try_merge_delay_insns (rtx_insn *insn, rtx_insn *thread) mark_set_resources (filled_insn, &set, 0, MARK_SRC_DEST_CALL); mark_referenced_resources (filled_insn, &needed, true); - for (i = 1; i < pat->len (); i++) + for (int i = 1; i < pat->len (); i++) { rtx_insn *dtrial = pat->insn (i); CLEAR_RESOURCE (&modified); /* Account for resources set by the insn following NEXT_TO_MATCH inside INSN's delay list. */ - for (j = 1; slot_number + j < num_slots; j++) + for (int j = 1; slot_number + j < num_slots; j++) mark_set_resources (XVECEXP (PATTERN (insn), 0, slot_number + j), &modified, 0, MARK_SRC_DEST_CALL); /* Account for resources set by the insn before DTRIAL and inside TRIAL's delay list. */ - for (j = 1; j < i; j++) + for (int j = 1; j < i; j++) mark_set_resources (XVECEXP (pat, 0, j), &modified, 0, MARK_SRC_DEST_CALL); if (! insn_references_resource_p (dtrial, &set, true) @@ -1411,24 +1410,22 @@ try_merge_delay_insns (rtx_insn *insn, rtx_insn *thread) { unsigned int len = merged_insns.length (); for (unsigned int i = len - 1; i < len; i--) - { - if (merged_insns[i].second) - { - 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[i].first, thread); - delete_related_insns (merged_insns[i].first); - } - } + if (merged_insns[i].second) + { + 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[i].first, thread); + delete_related_insns (merged_insns[i].first); + } INSN_ANNULLED_BRANCH_P (delay_insn) = 0; - for (i = 0; i < XVECLEN (PATTERN (insn), 0); i++) + for (int i = 0; i < XVECLEN (PATTERN (insn), 0); i++) INSN_FROM_TARGET_P (XVECEXP (PATTERN (insn), 0, i)) = 0; } } |