diff options
author | Richard Sandiford <richard@codesourcery.com> | 2007-01-24 08:16:14 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2007-01-24 08:16:14 +0000 |
commit | 92d545925396fd4588681b0fec6d7d4477eb6aec (patch) | |
tree | a3fabf06cb4bb14cd5c2965e324b64d493b67d2c | |
parent | 7122aa3b32c2e6d4c0de1565586b1f3735b6b9f4 (diff) | |
download | gcc-92d545925396fd4588681b0fec6d7d4477eb6aec.zip gcc-92d545925396fd4588681b0fec6d7d4477eb6aec.tar.gz gcc-92d545925396fd4588681b0fec6d7d4477eb6aec.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/reload1.c | 17 |
2 files changed, 22 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index abd821f..b1946e8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2007-01-24 Richard Sandiford <richard@codesourcery.com> + + * 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 <joseph@codesourcery.com> * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Define diff --git a/gcc/reload1.c b/gcc/reload1.c index efa1a39..8f7c703 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; |