diff options
| author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-24 08:16:14 +0000 |
|---|---|---|
| committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-24 08:16:14 +0000 |
| commit | 7b1ee155ffa56acb3a4e3206be0ba1b04499c714 (patch) | |
| tree | a3fabf06cb4bb14cd5c2965e324b64d493b67d2c | |
| parent | da2f0f2c26ca9ddeac3c5fb917a2bf89bcf38df9 (diff) | |
| download | ppe42-gcc-7b1ee155ffa56acb3a4e3206be0ba1b04499c714.tar.gz ppe42-gcc-7b1ee155ffa56acb3a4e3206be0ba1b04499c714.zip | |
gcc/
* reload1.c (emit_reload_insns): Pass the reload register
for a non-spill output reload through forget_old_reloads_1.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121105 138bc75d-0d04-0410-961f-82ee72b054a4
| -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 abd821fa2ae..b1946e83e7e 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 efa1a397212..8f7c703c415 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; |

