diff options
author | Christophe Lyon <christophe.lyon@linaro.org> | 2016-03-30 18:08:22 +0200 |
---|---|---|
committer | Linaro Code Review <review@review.linaro.org> | 2016-04-11 09:15:46 +0000 |
commit | 6355988b2bcf149cd2c3f198b92cd8b556b2d1bb (patch) | |
tree | 8334f1e404c77adb0b525d47e9f5f50dab43798b | |
parent | 65c6f3a40f16837c5bbdc7efccdafc0bf31c8ba6 (diff) |
gcc/
Backport from trunk r234568.
2016-03-30 Nick Clifton <nickc@redhat.com>
PR target/62254
* config/arm/arm.c (arm_reload_out_hi): Add code to handle the
case where we are already provided with an SImode SUBREG.
Change-Id: Ic59591e87d2d2575c3bc210de7ad3502db35bff7
-rw-r--r-- | gcc/config/arm/arm.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 8365a9da71c..e3958b6e782 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -15527,14 +15527,27 @@ arm_reload_out_hi (rtx *operands) /* The slot is out of range, or was dressed up in a SUBREG. */ base = reg_equiv_address (REGNO (ref)); - /* PR 62554: If there is no equivalent memory location then just move + /* PR 62254: If there is no equivalent memory location then just move the value as an SImode register move. This happens when the target architecture variant does not have an HImode register move. */ if (base == NULL) { - gcc_assert (REG_P (outval)); - emit_insn (gen_movsi (gen_rtx_SUBREG (SImode, ref, 0), - gen_rtx_SUBREG (SImode, outval, 0))); + gcc_assert (REG_P (outval) || SUBREG_P (outval)); + + if (REG_P (outval)) + { + emit_insn (gen_movsi (gen_rtx_SUBREG (SImode, ref, 0), + gen_rtx_SUBREG (SImode, outval, 0))); + } + else /* SUBREG_P (outval) */ + { + if (GET_MODE (SUBREG_REG (outval)) == SImode) + emit_insn (gen_movsi (gen_rtx_SUBREG (SImode, ref, 0), + SUBREG_REG (outval))); + else + /* FIXME: Handle other cases ? */ + gcc_unreachable (); + } return; } } |