https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65151

--- Comment #7 from Oleg Endo <olegendo at gcc dot gnu.org> ---
The following fixes the problem:

Index: gcc/config/sh/sh.c
===================================================================
--- gcc/config/sh/sh.c    (revision 220889)
+++ gcc/config/sh/sh.c    (working copy)
@@ -12049,6 +12049,9 @@
 bool
 sh_hard_regno_mode_ok (unsigned int regno, enum machine_mode mode)
 {
+  if (regno == T_REG)
+    return mode == SImode || mode == HImode || mode == QImode;
+
   if (SPECIAL_REGISTER_P (regno))
     return mode == SImode;

Index: gcc/config/sh/sh.md
===================================================================
--- gcc/config/sh/sh.md    (revision 220889)
+++ gcc/config/sh/sh.md    (working copy)
@@ -11224,6 +11224,13 @@
   "movt    %0"
   [(set_attr "type" "arith")])

+(define_insn "*movt"
+  [(set (match_operand:QIHI 0 "arith_reg_dest" "=r")
+    (match_operand:QIHI 1 "t_reg_operand"))]
+  "TARGET_SH1"
+  "movt    %0"
+  [(set_attr "type" "arith")])
+
 (define_insn "movrt"
   [(set (match_operand:SI 0 "arith_reg_dest" "=r")
     (xor:SI (match_operand:SI 1 "t_reg_operand" "") (const_int 1)))]


However, I've not tested it for any further side effects.

Reply via email to