From b81ac2881e267c356ae502af92da39d9837939de Mon Sep 17 00:00:00 2001 From: Paul Brook Date: Thu, 16 Feb 2006 15:14:23 +0000 Subject: reload1.c (emit_reload_insns): Invalidate dead input registers used for reloads. 2005-02-16 Paul Brook * reload1.c (emit_reload_insns): Invalidate dead input registers used for reloads. From-SVN: r111137 --- gcc/reload1.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'gcc/reload1.c') diff --git a/gcc/reload1.c b/gcc/reload1.c index 7bfd2a1..6746c78 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -7419,13 +7419,18 @@ emit_reload_insns (struct insn_chain *chain) /* If a register gets output-reloaded from a non-spill register, that invalidates any previous reloaded copy of it. But forget_old_reloads_1 won't get to see it, because - it thinks only about the original insn. So invalidate it here. */ - if (i < 0 && rld[r].out != 0 - && (REG_P (rld[r].out) - || (MEM_P (rld[r].out) + it thinks only about the original insn. So invalidate it here. + Also do the same thing for RELOAD_OTHER constraints where the + output is discarded. */ + if (i < 0 + && ((rld[r].out != 0 + && (REG_P (rld[r].out) + || (MEM_P (rld[r].out) + && REG_P (rld[r].out_reg)))) + || (rld[r].out == 0 && rld[r].out_reg && REG_P (rld[r].out_reg)))) { - rtx out = (REG_P (rld[r].out) + rtx out = ((rld[r].out && REG_P (rld[r].out)) ? rld[r].out : rld[r].out_reg); int nregno = REGNO (out); if (nregno >= FIRST_PSEUDO_REGISTER) @@ -7501,7 +7506,7 @@ emit_reload_insns (struct insn_chain *chain) } else { - int num_regs = hard_regno_nregs[nregno][GET_MODE (rld[r].out)]; + int num_regs = hard_regno_nregs[nregno][GET_MODE (out)]; while (num_regs-- > 0) reg_last_reload_reg[nregno + num_regs] = 0; -- cgit v1.1