aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1992-12-31 14:28:54 -0800
committerJim Wilson <wilson@gcc.gnu.org>1992-12-31 14:28:54 -0800
commit3002e1601b13c6a4cd4382788d97ebbd789e4ce9 (patch)
tree7e94784c1035d0cfba3c1744a4de9b76b1e0a35b
parentc3eebffbac077d5e5d5a0dbb1b9ff02ba568b77e (diff)
downloadgcc-3002e1601b13c6a4cd4382788d97ebbd789e4ce9.zip
gcc-3002e1601b13c6a4cd4382788d97ebbd789e4ce9.tar.gz
gcc-3002e1601b13c6a4cd4382788d97ebbd789e4ce9.tar.bz2
(gen_input_reload): Also handle PLUS of a MEM and CONSTANT specially.
From-SVN: r3029
-rw-r--r--gcc/reload1.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 6d66504..3af03a2 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -5698,9 +5698,10 @@ gen_input_reload (reloadreg, in, before_insn)
register that didn't get a hard register. In that case we can just
call emit_move_insn.
- We can also be asked to reload a PLUS that adds either two registers or
- a register and a constant or MEM. This can occur during frame pointer
- elimination. That case if handled by trying to emit a single insn
+ We can also be asked to reload a PLUS that adds either two registers, or
+ a register and a constant or MEM, or a MEM and a constant. This can
+ occur during frame pointer elimination and while reloading addresses.
+ This case is handled by trying to emit a single insn
to perform the add. If it is not valid, we use a two insn sequence.
Finally, we could be called to handle an 'o' constraint by putting
@@ -5719,16 +5720,18 @@ gen_input_reload (reloadreg, in, before_insn)
??? At some point, this whole thing needs to be rethought. */
if (GET_CODE (in) == PLUS
- && GET_CODE (XEXP (in, 0)) == REG
- && (GET_CODE (XEXP (in, 1)) == REG
- || CONSTANT_P (XEXP (in, 1))
- || GET_CODE (XEXP (in, 1)) == MEM))
+ && ((GET_CODE (XEXP (in, 0)) == REG
+ && (GET_CODE (XEXP (in, 1)) == REG
+ || CONSTANT_P (XEXP (in, 1))
+ || GET_CODE (XEXP (in, 1)) == MEM))
+ || (GET_CODE (XEXP (in, 0)) == MEM
+ && CONSTANT_P (XEXP (in, 1)))))
{
/* We need to compute the sum of what is either a register and a
- constant, a register and memory, or a hard register and a pseudo
- register and put it into the reload register. The best possible way
- of doing this is if the machine has a three-operand ADD insn that
- accepts the required operands.
+ constant, a register and memory, a hard register and a pseudo
+ register, or memory and a constant and put it into the reload
+ register. The best possible way of doing this is if the machine
+ has a three-operand ADD insn that accepts the required operands.
The simplest approach is to try to generate such an insn and see if it
is recognized and matches its constraints. If so, it can be used.