OSDN Git Service

* config/m68hc11/m68hc11.md ("*ashlsi3"): Operand 1 can be a memory
authorciceron <ciceron@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 5 Jul 2001 21:17:10 +0000 (21:17 +0000)
committerciceron <ciceron@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 5 Jul 2001 21:17:10 +0000 (21:17 +0000)
reference using the stack pointer, adjust it since we push Y
temporarily.
("*ashrsi3"): Likewise.
("*lshrsi3"): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@43791 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/m68hc11/m68hc11.md

index cd99757..03e9a4c 100644 (file)
@@ -1,3 +1,11 @@
+2001-07-04  Stephane Carrez  <Stephane.Carrez@worldnet.fr>
+
+       * config/m68hc11/m68hc11.md ("*ashlsi3"): Operand 1 can be a memory 
+       reference using the stack pointer, adjust it since we push Y 
+       temporarily.
+       ("*ashrsi3"): Likewise.
+       ("*lshrsi3"): Likewise.
+
 2001-07-05  Stephane Carrez  <Stephane.Carrez@worldnet.fr>
 
        * config/m68hc11/m68hc11.h (RETURN_ADDR_RTX): Fix return address
index b7b8fe3..f599204 100644 (file)
      is true for 68hc11 only, we save temporary the value of Y.  */
   if (!Y_REG_P (operands[2]))
     {
+      rtx ops[1];
+
+      ops[0] = operands[1];
       output_asm_insn (\"pshy\", operands);
-      output_asm_insn (\"ldy\\t%1\", operands);
+      if (reg_mentioned_p (stack_pointer_rtx, operands[1]))
+       {
+         ops[0] = adjust_address (operands[1], GET_MODE (operands[1]), 2);
+       }
+      output_asm_insn (\"ldy\\t%0\", ops);
       output_asm_insn (\"bsr\\t___ashlsi3\", operands);
       return \"puly\";
     }
      is true for 68hc11 only, we save temporary the value of Y.  */
   if (!Y_REG_P (operands[2]))
     {
+      rtx ops[1];
+
+      ops[0] = operands[1];
       output_asm_insn (\"pshy\", operands);
-      output_asm_insn (\"ldy\\t%1\", operands);
+      if (reg_mentioned_p (stack_pointer_rtx, operands[1]))
+       {
+         ops[0] = adjust_address (operands[1], GET_MODE (operands[1]), 2);
+       }
+      output_asm_insn (\"ldy\\t%0\", ops);
       output_asm_insn (\"bsr\\t___ashrsi3\", operands);
       return \"puly\";
     }
      is true for 68hc11 only, we save temporary the value of Y.  */
   if (!Y_REG_P (operands[2]))
     {
+      rtx ops[1];
+
+      ops[0] = operands[1];
       output_asm_insn (\"pshy\", operands);
-      output_asm_insn (\"ldy\\t%1\", operands);
+      if (reg_mentioned_p (stack_pointer_rtx, operands[1]))
+       {
+         ops[0] = adjust_address (operands[1], GET_MODE (operands[1]), 2);
+       }
+      output_asm_insn (\"ldy\\t%0\", ops);
       output_asm_insn (\"bsr\\t___lshrsi3\", operands);
       return \"puly\";
     }