m68hc11.c (m68hc11_gen_movhi): Fix move of sp to tmp reg.
authorStephane Carrez <Stephane.Carrez@worldnet.fr>
Sun, 30 Sep 2001 12:51:17 +0000 (14:51 +0200)
committerStephane Carrez <ciceron@gcc.gnu.org>
Sun, 30 Sep 2001 12:51:17 +0000 (14:51 +0200)
* config/m68hc11/m68hc11.c (m68hc11_gen_movhi): Fix move of sp
to tmp reg.

From-SVN: r45903

gcc/ChangeLog
gcc/config/m68hc11/m68hc11.c

index 60822bdae136d4da317e19609c3f59a38e9ce3dd..9d4f389cc7198a3507961187bbeff50caafc6fa0 100644 (file)
@@ -1,3 +1,8 @@
+2001-09-30  Stephane Carrez  <Stephane.Carrez@worldnet.fr>
+
+       * config/m68hc11/m68hc11.c (m68hc11_gen_movhi): Fix move of sp
+       to tmp reg.
+
 2001-09-30  Stephane Carrez  <Stephane.Carrez@worldnet.fr>
 
        * config/m68hc11/m68hc11.h(INCOMING_RETURN_ADDR_RTX): Remove so
index da45de0458a06fd80313721fb0c3605d0240a609..494de4703291fa3471ca3af21b8c1e0f8849574e 100644 (file)
@@ -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);