* mn10300.md (reload_insi): Handle SUBREG properly.
authorJeff Law <law@gcc.gnu.org>
Thu, 22 May 1997 05:35:37 +0000 (23:35 -0600)
committerJeff Law <law@gcc.gnu.org>
Thu, 22 May 1997 05:35:37 +0000 (23:35 -0600)
From-SVN: r14109

gcc/config/mn10300/mn10300.md

index 40d3868721fd15519f062db346156e64033adb1d..8fab7c11bf13b12592c633b15a2e87efc5479ec0 100644 (file)
   if (XEXP (operands[1], 0) == stack_pointer_rtx)
     {
       emit_move_insn (operands[0], XEXP (operands[1], 0));
-      emit_move_insn (operands[2], XEXP (operands[1], 1));
+      if (GET_CODE (XEXP (operands[1], 1)) == SUBREG
+         && (GET_MODE_SIZE (GET_MODE (XEXP (operands[1], 1)))
+             > GET_MODE_SIZE (GET_MODE (SUBREG_REG (XEXP (operands[1], 1))))))
+       emit_move_insn (operands[2],
+                       gen_rtx (ZERO_EXTEND, GET_MODE (XEXP (operands[1], 1)),
+                                SUBREG_REG (XEXP (operands[1], 1))));
+      else
+       emit_move_insn (operands[2], XEXP (operands[1], 1));
     }
   else
     {
       emit_move_insn (operands[0], XEXP (operands[1], 1));
-      emit_move_insn (operands[2], XEXP (operands[1], 0));
+      if (GET_CODE (XEXP (operands[1], 0)) == SUBREG
+         && (GET_MODE_SIZE (GET_MODE (XEXP (operands[1], 0)))
+             > GET_MODE_SIZE (GET_MODE (SUBREG_REG (XEXP (operands[1], 0))))))
+       emit_move_insn (operands[2],
+                       gen_rtx (ZERO_EXTEND, GET_MODE (XEXP (operands[1], 0)),
+                                SUBREG_REG (XEXP (operands[1], 0))));
+      else
+       emit_move_insn (operands[2], XEXP (operands[1], 0));
     }
   emit_insn (gen_addsi3 (operands[0], operands[0], operands[2]));
   DONE;