From 02a10130ff7e8ba65646253a4fea78aeef6ab5c2 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Sun, 13 Jan 2002 14:57:29 -0800 Subject: [PATCH] reload.c (find_reloads): Use a hard reg destination as reload reg for an input reload of the source. * reload.c (find_reloads): Use a hard reg destination as reload reg for an input reload of the source. From-SVN: r48822 --- gcc/ChangeLog | 5 +++++ gcc/reload.c | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e1464af2e81..ee3047beb59 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-01-13 Richard Henderson + + * reload.c (find_reloads): Use a hard reg destination as reload reg + for an input reload of the source. + 2002-01-13 Gerald Pfeifer * doc/install.texi (Binaries): Make link to ftp.writtenword.com diff --git a/gcc/reload.c b/gcc/reload.c index 39960509af9..8f82c9341f5 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -4241,6 +4241,23 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) rld[i].nregs = CLASS_MAX_NREGS (rld[i].class, rld[i].mode); } + /* Special case a simple move with an input reload and a + destination of a hard reg, if the hard reg is ok, use it. */ + for (i = 0; i < n_reloads; i++) + if (rld[i].when_needed == RELOAD_FOR_INPUT + && GET_CODE (PATTERN (insn)) == SET + && GET_CODE (SET_DEST (PATTERN (insn))) == REG + && SET_SRC (PATTERN (insn)) == rld[i].in) + { + rtx dest = SET_DEST (PATTERN (insn)); + unsigned int regno = REGNO (dest); + + if (regno < FIRST_PSEUDO_REGISTER + && TEST_HARD_REG_BIT (reg_class_contents[rld[i].class], regno) + && HARD_REGNO_MODE_OK (regno, rld[i].mode)) + rld[i].reg_rtx = dest; + } + return retval; } -- 2.30.2