aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/sh
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2020-03-25 14:33:08 -0600
committerJeff Law <law@redhat.com>2020-03-25 14:33:08 -0600
commit48817fbd7616f086ac7bb1dd38b862f78762c9b8 (patch)
tree4fd94bd2eccb10ceebfff48a606f4b3931140d1c /gcc/config/sh
parenteeb0c7c07133634eb5e98ba0348392684a763c95 (diff)
downloadgcc-48817fbd7616f086ac7bb1dd38b862f78762c9b8.zip
gcc-48817fbd7616f086ac7bb1dd38b862f78762c9b8.tar.gz
gcc-48817fbd7616f086ac7bb1dd38b862f78762c9b8.tar.bz2
Fix vector-compare-1 regressions on sh4/sh4eb caused by pattern clobbering T reg without expressing that in its RTL.
PR rtl-optimization/90275 * config/sh/sh.md (mov_neg_si_t): Clobber the T register in the pattern.
Diffstat (limited to 'gcc/config/sh')
-rw-r--r--gcc/config/sh/sh.md8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index 4a17971..fc80278 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -8395,9 +8395,15 @@
;; Store (negated) T bit as all zeros or ones in a reg.
;; subc Rn,Rn ! Rn = Rn - Rn - T; T = T
;; not Rn,Rn ! Rn = 0 - Rn
+;;
+;; Note the call to sh_split_treg_set_expr may clobber
+;; the T reg. We must express this, even though it's
+;; not immediately obvious this pattern changes the
+;; T register.
(define_insn_and_split "mov_neg_si_t"
[(set (match_operand:SI 0 "arith_reg_dest" "=r")
- (neg:SI (match_operand 1 "treg_set_expr")))]
+ (neg:SI (match_operand 1 "treg_set_expr")))
+ (clobber (reg:SI T_REG))]
"TARGET_SH1"
{
gcc_assert (t_reg_operand (operands[1], VOIDmode));