aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2024-06-21 09:52:42 +0100
committerRichard Sandiford <richard.sandiford@arm.com>2024-06-21 09:52:42 +0100
commitf49267e1636872128249431e9e5d20c0908b7e8e (patch)
treeb8b76622479fd394a16fe1601ca9b213909d0bab
parentfbe4dd20b9f25eaa0b6b90d008aff4708e47765b (diff)
downloadgcc-f49267e1636872128249431e9e5d20c0908b7e8e.zip
gcc-f49267e1636872128249431e9e5d20c0908b7e8e.tar.gz
gcc-f49267e1636872128249431e9e5d20c0908b7e8e.tar.bz2
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.
-rw-r--r--gcc/config/sh/sh.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index 92a1efe..9491b49 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"
"#"