re PR target/62254 (gcc-4.9 ICEs on linux kernel zlib for armv3)
authorNick Clifton <nickc@redhat.com>
Wed, 30 Mar 2016 12:48:42 +0000 (12:48 +0000)
committerNick Clifton <nickc@gcc.gnu.org>
Wed, 30 Mar 2016 12:48:42 +0000 (12:48 +0000)
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.

From-SVN: r234568

gcc/ChangeLog
gcc/config/arm/arm.c

index f09c0a0263881fc0668375b5cea1ce5c362b09b9..641bf2579c22a3073727395f85dd8e7905bf4057 100644 (file)
@@ -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>
 
index c868490d768ff3dc381df6e68e26bfad10478ded..5974c65d314c973d49a000ef458d6f765596f001 100644 (file)
@@ -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;
        }
     }