aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJames Van Artsdalen <jrv@gnu.org>1992-09-17 05:20:26 +0000
committerJames Van Artsdalen <jrv@gnu.org>1992-09-17 05:20:26 +0000
commit442426450eaaabd3136578270ca3443004510f28 (patch)
treebcdb92a3bf2493dca0b266a3323cca6ee2d3d163 /gcc
parent3292923dd1d498fbd3cf472164972636f8925220 (diff)
downloadgcc-442426450eaaabd3136578270ca3443004510f28.zip
gcc-442426450eaaabd3136578270ca3443004510f28.tar.gz
gcc-442426450eaaabd3136578270ca3443004510f28.tar.bz2
(addsi3,ashlsi3): Handle the case where the stack pointer appears as an
index reg. From-SVN: r2140
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/i386/i386.md22
1 files changed, 20 insertions, 2 deletions
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 6ba86cd..2d2f28e 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -1392,8 +1392,20 @@
if (! TARGET_486 || ! REG_P (operands[2]))
{
CC_STATUS_INIT;
- operands[1] = SET_SRC (PATTERN (insn));
- return AS2 (lea%L0,%a1,%0);
+
+ if (operands[2] == stack_pointer_rtx)
+ {
+ rtx temp;
+
+ temp = operands[1];
+ operands[1] = operands[2];
+ operands[2] = temp;
+ }
+ if (operands[2] != stack_pointer_rtx)
+ {
+ operands[1] = SET_SRC (PATTERN (insn));
+ return AS2 (lea%L0,%a1,%0);
+ }
}
output_asm_insn (AS2 (mov%L0,%1,%0), operands);
@@ -2391,6 +2403,12 @@
else
{
CC_STATUS_INIT;
+
+ if (operands[1] == stack_pointer_rtx)
+ {
+ output_asm_insn (AS2 (mov%L0,%1,%0), operands);
+ operands[1] = operands[0];
+ }
operands[1] = gen_rtx (MULT, SImode, operands[1],
GEN_INT (1 << INTVAL (operands[2])));
return AS2 (lea%L0,%a1,%0);