aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJeff Law <law@gcc.gnu.org>1997-05-21 23:35:37 -0600
committerJeff Law <law@gcc.gnu.org>1997-05-21 23:35:37 -0600
commitbb75a000abe6aa89c3544435ce56bebb6da69167 (patch)
tree6c434a8e0b6a4387e5b9e6a155d6b9588c161cde /gcc
parent5bef9b1f9d52d6f8a5a65b8f680d2e39bf2dce6d (diff)
downloadgcc-bb75a000abe6aa89c3544435ce56bebb6da69167.zip
gcc-bb75a000abe6aa89c3544435ce56bebb6da69167.tar.gz
gcc-bb75a000abe6aa89c3544435ce56bebb6da69167.tar.bz2
* mn10300.md (reload_insi): Handle SUBREG properly.
From-SVN: r14109
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/mn10300/mn10300.md18
1 files changed, 16 insertions, 2 deletions
diff --git a/gcc/config/mn10300/mn10300.md b/gcc/config/mn10300/mn10300.md
index 40d3868..8fab7c1 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;