&& NOTE_LINE_NUMBER (note) == NOTE_INSN_PROLOGUE_END)
break;
}
+
next = NEXT_INSN (note);
prev = PREV_INSN (note);
if (prev)
NEXT_INSN (prev) = next;
if (next)
PREV_INSN (next) = prev;
+
+ /* Whether or not we can depend on basic_block_head,
+ attempt to keep it up-to-date. */
+ if (basic_block_head[0] == note)
+ basic_block_head[0] = next;
+
add_insn_after (note, insn);
}
}
NEXT_INSN (prev) = next;
if (next)
PREV_INSN (next) = prev;
- add_insn_after (note, PREV_INSN (insn));
+
+ /* Whether or not we can depend on basic_block_head,
+ attempt to keep it up-to-date. */
+ if (n_basic_blocks
+ && basic_block_head[n_basic_blocks-1] == insn)
+ basic_block_head[n_basic_blocks-1] = note;
+
+ add_insn_before (note, insn);
}
}
}
static int allocate_reload_reg PROTO((int, rtx, int, int));
static void choose_reload_regs PROTO((rtx, rtx));
static void merge_assigned_reloads PROTO((rtx));
-static void emit_reload_insns PROTO((rtx));
+static void emit_reload_insns PROTO((rtx, int));
static void delete_output_reload PROTO((rtx, int, rtx));
static void inc_for_reload PROTO((rtx, rtx, int));
static int constraint_accepts_reg_p PROTO((char *, rtx));
/* Generate the insns to reload operands into or out of
their reload regs. */
- emit_reload_insns (insn);
+ emit_reload_insns (insn, this_block);
/* Substitute the chosen reload regs from reload_reg_rtx
into the insn's body (or perhaps into the bodies of other
/* Output insns to reload values in and out of the chosen reload regs. */
static void
-emit_reload_insns (insn)
+emit_reload_insns (insn, bb)
rtx insn;
+ int bb;
{
register int j;
rtx input_reload_insns[MAX_RECOG_OPERANDS];
rtx other_operand_reload_insns = 0;
rtx other_output_reload_insns[MAX_RECOG_OPERANDS];
rtx following_insn = NEXT_INSN (insn);
- rtx before_insn = insn;
+ rtx before_insn = PREV_INSN (insn);
int special;
/* Values to be put in spill_reg_store are put here first. */
rtx new_spill_reg_store[FIRST_PSEUDO_REGISTER];
reloads for the operand. The RELOAD_OTHER output reloads are
output in descending order by reload number. */
- emit_insns_before (other_input_address_reload_insns, before_insn);
- emit_insns_before (other_input_reload_insns, before_insn);
+ emit_insns_before (other_input_address_reload_insns, insn);
+ emit_insns_before (other_input_reload_insns, insn);
for (j = 0; j < reload_n_operands; j++)
{
- emit_insns_before (inpaddr_address_reload_insns[j], before_insn);
- emit_insns_before (input_address_reload_insns[j], before_insn);
- emit_insns_before (input_reload_insns[j], before_insn);
+ emit_insns_before (inpaddr_address_reload_insns[j], insn);
+ emit_insns_before (input_address_reload_insns[j], insn);
+ emit_insns_before (input_reload_insns[j], insn);
}
- emit_insns_before (other_operand_reload_insns, before_insn);
- emit_insns_before (operand_reload_insns, before_insn);
+ emit_insns_before (other_operand_reload_insns, insn);
+ emit_insns_before (operand_reload_insns, insn);
for (j = 0; j < reload_n_operands; j++)
{
emit_insns_before (other_output_reload_insns[j], following_insn);
}
+ /* Keep basic block info up to date. */
+ if (n_basic_blocks)
+ {
+ if (basic_block_head[bb] == insn)
+ basic_block_head[bb] = NEXT_INSN (before_insn);
+ if (basic_block_end[bb] == insn)
+ basic_block_end[bb] = PREV_INSN (following_insn);
+ }
+
/* Move death notes from INSN
to output-operand-address and output reload insns. */
#ifdef PRESERVE_DEATH_INFO_REGNO_P