This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH]: Fix move for HC11
- To: gcc-patches at gcc dot gnu dot org
- Subject: [PATCH]: Fix move for HC11
- From: Stephane Carrez <Stephane dot Carrez at worldnet dot fr>
- Date: Sun, 30 Sep 2001 14:57:08 +0200
Hi!
I've committed the following patch on 3_0 branch and mainline to
fix the move of sp to a tmp register.
Stephane
2001-09-30 Stephane Carrez <Stephane.Carrez@worldnet.fr>
* config/m68hc11/m68hc11.c (m68hc11_gen_movhi): Fix move of sp
to tmp reg.
Index: config/m68hc11/m68hc11.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m68hc11/m68hc11.c,v
retrieving revision 1.22
diff -u -p -r1.22 m68hc11.c
--- m68hc11.c 2001/09/21 01:27:05 1.22
+++ m68hc11.c 2001/09/30 12:48:49
@@ -3299,7 +3299,17 @@ m68hc11_gen_movhi (insn, operands)
if (ix_reg == 0)
create_regs_rtx ();
- if (reg_mentioned_p (ix_reg, operands[0]))
+ if (REG_P (operands[0]) && REGNO (operands[0]) == SOFT_TMP_REGNUM)
+ {
+ output_asm_insn ("pshx", operands);
+ output_asm_insn ("tsx", operands);
+ output_asm_insn ("inx", operands);
+ output_asm_insn ("inx", operands);
+ output_asm_insn ("stx\t%0", operands);
+ output_asm_insn ("pulx", operands);
+ }
+
+ else if (reg_mentioned_p (ix_reg, operands[0]))
{
output_asm_insn ("sty\t%t0", operands);
output_asm_insn ("tsy", operands);