https://gcc.gnu.org/g:f49267e1636872128249431e9e5d20c0908b7e8e

commit r15-1531-gf49267e1636872128249431e9e5d20c0908b7e8e
Author: Richard Sandiford <richard.sandif...@arm.com>
Date:   Fri Jun 21 09:52:42 2024 +0100

    sh: Make *minus_plus_one work after RA
    
    *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.

Diff:
---
 gcc/config/sh/sh.md | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index 92a1efeb811..9491b49e55b 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -1642,9 +1642,9 @@
 ;; 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"
   "#"

Reply via email to