From: Jeff Law Date: Thu, 22 May 1997 05:35:37 +0000 (-0600) Subject: * mn10300.md (reload_insi): Handle SUBREG properly. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bb75a000abe6aa89c3544435ce56bebb6da69167;p=gcc.git * mn10300.md (reload_insi): Handle SUBREG properly. From-SVN: r14109 --- diff --git a/gcc/config/mn10300/mn10300.md b/gcc/config/mn10300/mn10300.md index 40d3868721f..8fab7c11bf1 100644 --- a/gcc/config/mn10300/mn10300.md +++ b/gcc/config/mn10300/mn10300.md @@ -167,12 +167,26 @@ 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;