switch (code)
{
case PLUS:
+ if (DEBUG_INSN_P (insn))
+ break;
+
{
rtx orig_op0 = XEXP (x, 0);
rtx orig_op1 = XEXP (x, 1);
static bool
replace_oldest_value_mem (rtx x, rtx insn, struct value_data *vd)
{
- return replace_oldest_value_addr (&XEXP (x, 0),
- base_reg_class (GET_MODE (x), MEM,
- SCRATCH),
+ enum reg_class cl;
+
+ if (DEBUG_INSN_P (insn))
+ cl = ALL_REGS;
+ else
+ cl = base_reg_class (GET_MODE (x), MEM, SCRATCH);
+
+ return replace_oldest_value_addr (&XEXP (x, 0), cl,
GET_MODE (x), insn, vd);
}
static bool
copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd)
{
- bool changed = false;
+ bool anything_changed = false;
rtx insn;
for (insn = BB_HEAD (bb); ; insn = NEXT_INSN (insn))
bool is_asm, any_replacements;
rtx set;
bool replaced[MAX_RECOG_OPERANDS];
+ bool changed = false;
- if (! INSN_P (insn))
+ if (!NONDEBUG_INSN_P (insn))
{
+ if (DEBUG_INSN_P (insn))
+ {
+ rtx loc = INSN_VAR_LOCATION_LOC (insn);
+ if (!VAR_LOC_UNKNOWN_P (loc)
+ && replace_oldest_value_addr (&INSN_VAR_LOCATION_LOC (insn),
+ ALL_REGS, GET_MODE (loc),
+ insn, vd))
+ {
+ changed = apply_change_group ();
+ gcc_assert (changed);
+ df_insn_rescan (insn);
+ anything_changed = true;
+ }
+ }
+
if (insn == BB_END (bb))
break;
else
}
did_replacement:
+ if (changed)
+ {
+ df_insn_rescan (insn);
+ anything_changed = true;
+ }
+
/* Clobber call-clobbered registers. */
if (CALL_P (insn))
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
break;
}
- return changed;
+ return anything_changed;
}
/* Main entry point for the forward copy propagation optimization. */