This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/81821] [RX] xchg_mem<mode> uses wrong memory operand size
- From: "olegendo at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 11 Aug 2017 14:32:34 +0000
- Subject: [Bug target/81821] [RX] xchg_mem<mode> uses wrong memory operand size
- Auto-submitted: auto-generated
- References: <bug-81821-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81821
--- Comment #2 from Oleg Endo <olegendo at gcc dot gnu.org> ---
A possible fix:
Index: gcc/config/rx/rx.md
===================================================================
--- gcc/config/rx/rx.md (revision 251045)
+++ gcc/config/rx/rx.md (working copy)
@@ -2167,6 +2167,7 @@
[(plus "add") (minus "sub") (ior "ior") (xor "xor") (and "and")])
(define_mode_iterator QIHI [QI HI])
+(define_mode_attr BW [(QI "B") (HI "W")])
(define_insn "sync_lock_test_and_setsi"
[(set (match_operand:SI 0 "register_operand" "=r,r")
@@ -2208,7 +2209,7 @@
(set (match_dup 1)
(match_operand:QIHI 2 "register_operand" "0"))]
""
- "xchg\t%1, %0"
+ "xchg\t%1.<BW>, %0"
[(set_attr "length" "6")
(set_attr "timings" "22")]
)