aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorOleg Endo <olegendo@gcc.gnu.org>2014-12-21 23:37:42 +0000
committerOleg Endo <olegendo@gcc.gnu.org>2014-12-21 23:37:42 +0000
commit463d52c2379d7c174f0bdf11d41ae602eab2c857 (patch)
treefce65b4bb96d390704dbae75266024bce5d75639 /gcc/config
parent9b09bfac867d563cbd2ec6fdffc7b7e4239b51ad (diff)
downloadgcc-463d52c2379d7c174f0bdf11d41ae602eab2c857.zip
gcc-463d52c2379d7c174f0bdf11d41ae602eab2c857.tar.gz
gcc-463d52c2379d7c174f0bdf11d41ae602eab2c857.tar.bz2
re PR target/55212 ([SH] Switch to LRA)
gcc/ PR target/55212 * config/sh/sh.md (*addsi3_compact): Add parentheses around && condition. Add comments. From-SVN: r218999
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/sh/sh.md12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index a74e17f..7b68aa1 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -2056,14 +2056,20 @@
[(set_attr "type" "arith_media")
(set_attr "highpart" "ignore")])
+;; The *addsi3_compact is made an insn_and_split and accepts actually
+;; impossible constraints to make LRA's register elimination work well on SH.
+;; The problem is that LRA expects something like
+;; (set rA (plus rB (const_int N)))
+;; to work. We can do that, but we have to split out an additional reg-reg
+;; copy before the actual add insn.
(define_insn_and_split "*addsi3_compact"
[(set (match_operand:SI 0 "arith_reg_dest" "=r,&r")
(plus:SI (match_operand:SI 1 "arith_operand" "%0,r")
(match_operand:SI 2 "arith_or_int_operand" "rI08,rn")))]
"TARGET_SH1
- && (rtx_equal_p (operands[0], operands[1])
- && arith_operand (operands[2], SImode))
- || ! reg_overlap_mentioned_p (operands[0], operands[1])"
+ && ((rtx_equal_p (operands[0], operands[1])
+ && arith_operand (operands[2], SImode))
+ || ! reg_overlap_mentioned_p (operands[0], operands[1]))"
"@
add %2,%0
#"