From: Richard Sandiford Date: Wed, 24 Jan 2007 08:16:14 +0000 (+0000) Subject: reload1.c (emit_reload_insns): Pass the reload register for a non-spill output reload... X-Git-Tag: releases/gcc-4.3.0~7296 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=92d545925396fd4588681b0fec6d7d4477eb6aec;p=thirdparty%2Fgcc.git reload1.c (emit_reload_insns): Pass the reload register for a non-spill output reload through forget_old_reloads_1. gcc/ * reload1.c (emit_reload_insns): Pass the reload register for a non-spill output reload through forget_old_reloads_1. From-SVN: r121105 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index abd821fa2aea..b1946e83e7e0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2007-01-24 Richard Sandiford + + * reload1.c (emit_reload_insns): Pass the reload register + for a non-spill output reload through forget_old_reloads_1. + 2007-01-23 Joseph Myers * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Define diff --git a/gcc/reload1.c b/gcc/reload1.c index efa1a397212f..8f7c703c4151 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -7561,6 +7561,23 @@ emit_reload_insns (struct insn_chain *chain) rtx out = ((rld[r].out && REG_P (rld[r].out)) ? rld[r].out : rld[r].out_reg); int nregno = REGNO (out); + + /* REG_RTX is now set or clobbered by the main instruction. + As the comment above explains, forget_old_reloads_1 only + sees the original instruction, and there is no guarantee + that the original instruction also clobbered REG_RTX. + For example, if find_reloads sees that the input side of + a matched operand pair dies in this instruction, it may + use the input register as the reload register. + + Calling forget_old_reloads_1 is a waste of effort if + REG_RTX is also the output register. + + If we know that REG_RTX holds the value of a pseudo + register, the code after the call will record that fact. */ + if (rld[r].reg_rtx && rld[r].reg_rtx != out) + forget_old_reloads_1 (rld[r].reg_rtx, NULL_RTX, NULL); + if (nregno >= FIRST_PSEUDO_REGISTER) { rtx src_reg, store_insn = NULL_RTX;