Hi,

Since the recent changes in combine w.r.t. canonical forms of ashift and
mult outside mems, some of the SH patterns stopped working.  The
attached patch fixes the failures in gcc.target/sh/pr54236-1.c.

Tested briefly with
make -k check-gcc RUNTESTFLAGS="sh.exp --target_board=sh-sim
\{-m2/-ml,-m2/-mb,-m2a/-mb,-m4/-ml,-m4/-mb,-m4a/-ml,-m4a/-mb}"

Committed as r223274.

Cheers,
Oleg

gcc/ChangeLog:
        PR target/54236
        * config/sh/sh.md (*addc_2r_t): Use ashift instead of mult.
Index: gcc/config/sh/sh.md
===================================================================
--- gcc/config/sh/sh.md	(revision 223270)
+++ gcc/config/sh/sh.md	(working copy)
@@ -2040,8 +2040,8 @@
 (define_insn_and_split "*addc_2r_t"
   [(set (match_operand:SI 0 "arith_reg_dest")
 	(plus:SI (match_operand 1 "treg_set_expr")
-		 (mult:SI (match_operand:SI 2 "arith_reg_operand")
-			  (const_int 2))))
+		 (ashift:SI (match_operand:SI 2 "arith_reg_operand")
+			    (const_int 1))))
    (clobber (reg:SI T_REG))]
   "TARGET_SH1 && can_create_pseudo_p ()"
   "#"
@@ -2052,8 +2052,8 @@
 
 (define_insn_and_split "*addc_2r_t"
   [(set (match_operand:SI 0 "arith_reg_dest")
-	(plus:SI (mult:SI (match_operand:SI 1 "arith_reg_operand")
-			  (const_int 2))
+	(plus:SI (ashift:SI (match_operand:SI 1 "arith_reg_operand")
+			    (const_int 1))
 		 (match_operand 2 "treg_set_expr")))
    (clobber (reg:SI T_REG))]
   "TARGET_SH1 && can_create_pseudo_p ()"

Reply via email to