]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/65249 (unable to find a register to spill in class 'R0_REGS' when compil...
authorKaz Kojima <kkojima@gcc.gnu.org>
Sat, 25 Jul 2015 01:26:55 +0000 (01:26 +0000)
committerKaz Kojima <kkojima@gcc.gnu.org>
Sat, 25 Jul 2015 01:26:55 +0000 (01:26 +0000)
PR target/65249
* config/sh/sh.md (movdi): Split simple reg move to two movsi when
  the destination is R0 so as to lower R0-register pressure.

From-SVN: r226201

gcc/ChangeLog
gcc/config/sh/sh.md

index b33cbd424b4a5e6ee31d9f1691ea6a0a75e46cee..f037688d15e1b4c7d1b05b31a2dfe2a084162a4f 100644 (file)
@@ -1,3 +1,12 @@
+2015-07-25  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+       Backport from mainline
+       2015-07-16  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+       PR target/65249
+       * config/sh/sh.md (movdi): Split simple reg move to two movsi
+       when the destination is R0.
+
 2015-07-24  Szabolcs Nagy  <szabolcs.nagy@arm.com>
 
        Backported from mainline r226159.
index 488b6651e25ddec696b83c067c89d723ed057743..c1caabd3a10f8dc035dbc553929d4c7952bf44ea 100644 (file)
@@ -7448,6 +7448,24 @@ label:
   ""
 {
   prepare_move_operands (operands, DImode);
+  if (TARGET_SH1)
+    {
+      /* When the dest operand is (R0, R1) register pair, split it to
+        two movsi of which dest is R1 and R0 so as to lower R0-register
+        pressure on the first movsi.  Apply only for simple source not
+        to make complex rtl here.  */
+      if (REG_P (operands[0])
+         && REGNO (operands[0]) == R0_REG
+         && REG_P (operands[1])
+         && REGNO (operands[1]) >= FIRST_PSEUDO_REGISTER)
+       {
+         emit_insn (gen_movsi (gen_rtx_REG (SImode, R1_REG),
+                               gen_rtx_SUBREG (SImode, operands[1], 4)));
+         emit_insn (gen_movsi (gen_rtx_REG (SImode, R0_REG),
+                               gen_rtx_SUBREG (SImode, operands[1], 0)));
+         DONE;
+       }
+    }
 })
 
 (define_insn "movdf_media"