]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
sh: Make *minus_plus_one work after RA
authorRichard Sandiford <richard.sandiford@arm.com>
Fri, 21 Jun 2024 08:52:42 +0000 (09:52 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Fri, 21 Jun 2024 08:52:42 +0000 (09:52 +0100)
*minus_plus_one had no constraints, which meant that it could be
matched after RA with operands 0, 1 and 2 all being different.
The associated split instead requires operand 0 to be tied to
operand 1.

gcc/
* config/sh/sh.md (*minus_plus_one): Add constraints.

gcc/config/sh/sh.md

index 92a1efeb811f8f1d87b91ff7c22a1e6fb01a2d53..9491b49e55b681a0013591a364c5589872de589e 100644 (file)
 ;; matched.  Split this up into a simple sub add sequence, as this will save
 ;; us one sett insn.
 (define_insn_and_split "*minus_plus_one"
-  [(set (match_operand:SI 0 "arith_reg_dest" "")
-       (plus:SI (minus:SI (match_operand:SI 1 "arith_reg_operand" "")
-                          (match_operand:SI 2 "arith_reg_operand" ""))
+  [(set (match_operand:SI 0 "arith_reg_dest" "=r")
+       (plus:SI (minus:SI (match_operand:SI 1 "arith_reg_operand" "0")
+                          (match_operand:SI 2 "arith_reg_operand" "r"))
                 (const_int 1)))]
   "TARGET_SH1"
   "#"