aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/cris
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2012-04-25 22:31:36 +0000
committerHans-Peter Nilsson <hp@gcc.gnu.org>2012-04-25 22:31:36 +0000
commitd71735933a8f4dc0b473ffa7c1aaafcaddea3d5a (patch)
treed2bae6b2ab036950665bebad2209e0b55567f7c1 /gcc/config/cris
parentc1d40097cbfefceed04bbb3d3c9e14dcf7b27403 (diff)
downloadgcc-d71735933a8f4dc0b473ffa7c1aaafcaddea3d5a.zip
gcc-d71735933a8f4dc0b473ffa7c1aaafcaddea3d5a.tar.gz
gcc-d71735933a8f4dc0b473ffa7c1aaafcaddea3d5a.tar.bz2
re PR target/53120 (ICE exposing strict_low_part / in/out operand thinko -fno-tree-sra)
PR target/53120 * config/cris/cris.md ("*andhi_lowpart_v32") ("*andqi_lowpart_v32"): Change first input-only operand from a (match_operand ...) to (match_dup 0). Drop alternatives with const_int-matching constraints for redundancy. ("*andhi_lowpart_non_v32", "*andqi_lowpart_non_v32"): Ditto. Drop three-operand alternative. From-SVN: r186843
Diffstat (limited to 'gcc/config/cris')
-rw-r--r--gcc/config/cris/cris.md91
1 files changed, 51 insertions, 40 deletions
diff --git a/gcc/config/cris/cris.md b/gcc/config/cris/cris.md
index 5352594..febe6f5 100644
--- a/gcc/config/cris/cris.md
+++ b/gcc/config/cris/cris.md
@@ -2915,36 +2915,51 @@
;; A strict_low_part pattern.
+;; Note the use of (match_dup 0) for the first operand of the operation
+;; here. Reload can't handle an operand pair where one is read-write
+;; and must match a read, like in:
+;; (insn 80 79 81 4
+;; (set (strict_low_part
+;; (subreg:QI (reg/v:SI 0 r0 [orig:36 data ] [36]) 0))
+;; (and:QI
+;; (subreg:QI (reg:SI 15 acr [orig:27 D.7531 ] [27]) 0)
+;; (const_int -64 [0xf..fc0]))) x.c:126 147 {*andqi_lowpart_v32}
+;; (nil))
+;; In theory, it could reload this as a movstrictqi of the register
+;; operand at the and:QI to the destination register and change the
+;; and:QI operand to the same as the read-write output operand and the
+;; result would be recognized, but it doesn't recognize that's a valid
+;; reload for a strict_low_part-destination; it just sees a "+" at the
+;; destination constraints. Better than adding complexity to reload is
+;; to follow the lead of m68k (see comment that begins with "These insns
+;; must use MATCH_DUP") since prehistoric times and make it just a
+;; match_dup. FIXME: a sanity-check in gen* to refuse an insn with
+;; input-constraints matching input-output-constraints, e.g. "+r" <- "0".
+
(define_insn "*andhi_lowpart_non_v32"
[(set (strict_low_part
- (match_operand:HI 0 "register_operand" "+r,r, r,r,r,r"))
- (and:HI (match_operand:HI 1 "register_operand" "%0,0, 0,0,0,r")
- (match_operand:HI 2 "general_operand" "r,Q>,L,O,g,!To")))]
+ (match_operand:HI 0 "register_operand" "+r,r,r"))
+ (and:HI (match_dup 0)
+ (match_operand:HI 1 "general_operand" "r,Q>,g")))]
"!TARGET_V32"
"@
- and.w %2,%0
- and.w %2,%0
- and.w %2,%0
- anDq %b2,%0
- and.w %2,%0
- and.w %2,%1,%0"
- [(set_attr "slottable" "yes,yes,no,yes,no,no")
- (set_attr "cc" "normal,normal,normal,clobber,normal,normal")])
+ and.w %1,%0
+ and.w %1,%0
+ and.w %1,%0"
+ [(set_attr "slottable" "yes,yes,no")])
(define_insn "*andhi_lowpart_v32"
[(set (strict_low_part
- (match_operand:HI 0 "register_operand" "+r,r,r,r,r"))
- (and:HI (match_operand:HI 1 "register_operand" "%0,0,0,0,0")
- (match_operand:HI 2 "general_operand" "r,Q>,L,O,g")))]
+ (match_operand:HI 0 "register_operand" "+r,r,r"))
+ (and:HI (match_dup 0)
+ (match_operand:HI 1 "general_operand" "r,Q>,g")))]
"TARGET_V32"
"@
- and.w %2,%0
- and.w %2,%0
- and.w %2,%0
- anDq %b2,%0
- and.w %2,%0"
- [(set_attr "slottable" "yes,yes,no,yes,no")
- (set_attr "cc" "noov32,noov32,noov32,clobber,noov32")])
+ and.w %1,%0
+ and.w %1,%0
+ and.w %1,%0"
+ [(set_attr "slottable" "yes,yes,no")
+ (set_attr "cc" "noov32")])
(define_expand "andqi3"
[(set (match_operand:QI 0 "register_operand")
@@ -2984,32 +2999,28 @@
(define_insn "*andqi_lowpart_non_v32"
[(set (strict_low_part
- (match_operand:QI 0 "register_operand" "+r,r, r,r,r"))
- (and:QI (match_operand:QI 1 "register_operand" "%0,0, 0,0,r")
- (match_operand:QI 2 "general_operand" "r,Q>,O,g,!To")))]
+ (match_operand:QI 0 "register_operand" "+r,r,r"))
+ (and:QI (match_dup 0)
+ (match_operand:QI 1 "general_operand" "r,Q>,g")))]
"!TARGET_V32"
"@
- and.b %2,%0
- and.b %2,%0
- andQ %b2,%0
- and.b %2,%0
- and.b %2,%1,%0"
- [(set_attr "slottable" "yes,yes,yes,no,no")
- (set_attr "cc" "normal,normal,clobber,normal,normal")])
+ and.b %1,%0
+ and.b %1,%0
+ and.b %1,%0"
+ [(set_attr "slottable" "yes,yes,no")])
(define_insn "*andqi_lowpart_v32"
[(set (strict_low_part
- (match_operand:QI 0 "register_operand" "+r,r,r,r"))
- (and:QI (match_operand:QI 1 "register_operand" "%0,0,0,0")
- (match_operand:QI 2 "general_operand" "r,Q>,O,g")))]
+ (match_operand:QI 0 "register_operand" "+r,r,r"))
+ (and:QI (match_dup 0)
+ (match_operand:QI 1 "general_operand" "r,Q>,g")))]
"TARGET_V32"
"@
- and.b %2,%0
- and.b %2,%0
- andQ %b2,%0
- and.b %2,%0"
- [(set_attr "slottable" "yes,yes,yes,no")
- (set_attr "cc" "noov32,noov32,clobber,noov32")])
+ and.b %1,%0
+ and.b %1,%0
+ and.b %1,%0"
+ [(set_attr "slottable" "yes,yes,no")
+ (set_attr "cc" "noov32")])
;; Bitwise or.