aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2016-03-30 12:48:42 +0000
committerNick Clifton <nickc@redhat.com>2016-03-30 12:48:42 +0000
commit356d4d35dbc9bd1ff1215ef707b9a85a7b119af7 (patch)
tree234abe964d2af48711cc1b4922b78b206008359c /gcc
parentec5e50007cf2e3a8f487bd187e1779113da3f193 (diff)
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. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@234568 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/arm/arm.c21
2 files changed, 23 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f09c0a02638..641bf2579c2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+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.
+
2016-03-30 Michael Matz <matz@suse.de>
Richard Biener <rguenther@suse.de>
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index c868490d768..5974c65d314 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -15596,14 +15596,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;
}
}