summaryrefslogtreecommitdiff
path: root/gcc/config/m68hc11
diff options
context:
space:
mode:
authorciceron <ciceron@138bc75d-0d04-0410-961f-82ee72b054a4>2001-10-01 13:33:55 +0000
committerciceron <ciceron@138bc75d-0d04-0410-961f-82ee72b054a4>2001-10-01 13:33:55 +0000
commit7c075cc25176adbb52ead1981f7aa61f6ff1cdb5 (patch)
tree754073a1a176494e6f0c6a907846045296640eb1 /gcc/config/m68hc11
parent73b3695109dd83667b4ed49f9526134c47f59419 (diff)
downloadgcc-7c075cc25176adbb52ead1981f7aa61f6ff1cdb5.tar.gz
* config/m68hc11/m68hc11.md ("add-split"): Fix add split when
operand 2 is the stack pointer. ("addr-peephole"): Fix address computation peephole when operand 2 is the stack pointer. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45925 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/m68hc11')
-rw-r--r--gcc/config/m68hc11/m68hc11.md14
1 files changed, 10 insertions, 4 deletions
diff --git a/gcc/config/m68hc11/m68hc11.md b/gcc/config/m68hc11/m68hc11.md
index a5e178726e8..d978f960807 100644
--- a/gcc/config/m68hc11/m68hc11.md
+++ b/gcc/config/m68hc11/m68hc11.md
@@ -3657,8 +3657,9 @@
(set (match_dup 0) (reg:HI D_REGNUM))])]
"
/* Save the operand2 in a temporary location and use it. */
- if (H_REG_P (operands[2])
- || reg_mentioned_p (operands[0], operands[2]))
+ if ((H_REG_P (operands[2])
+ || reg_mentioned_p (operands[0], operands[2]))
+ && !(SP_REG_P (operands[2]) && GET_CODE (operands[3]) == PLUS))
{
operands[4] = gen_rtx (REG, HImode, SOFT_TMP_REGNUM);
operands[6] = operands[4];
@@ -6121,9 +6122,14 @@
{
int value_loaded = 1;
- if (X_REG_P (operands[0]))
+ if (X_REG_P (operands[0]) || SP_REG_P (operands[2]))
{
- output_asm_insn (\"ldx\\t%2\\n\\txgdx\", operands);
+ rtx ops[2];
+
+ ops[0] = operands[0];
+ ops[1] = operands[2];
+ m68hc11_gen_movhi (insn, ops);
+ output_asm_insn (\"xgd%0\", operands);
}
else if (Y_REG_P (operands[0]))
{