[RX] Fix PR 81821

Message ID 1515683259.12491.10.camel@t-online.de
State New
Headers show
Series
  • [RX] Fix PR 81821
Related show

Commit Message

Oleg Endo Jan. 11, 2018, 3:07 p.m.
Hi,

The attached patch fixes PR 81821.  It is the same as the patch
proposed in the PR.  I have briefly checked it in a private application
that uses atomic variables and I think it's rather obvious.

I have added atomics support on RX in GCC 7 and that was an initial
bug.  Thus I'd like to also apply it to the GCC 7 branch.

OK for trunk and GCC 7?

Cheers,
Oleg

gcc/ChangeLog:
	* config/rx/rx.md (BW): New mode attribute.
	(sync_lock_test_and_setsi): Add mode suffix to insn output.

Comments

Nick Clifton Jan. 11, 2018, 3:10 p.m. | #1
Hi Oleg,

> OK for trunk and GCC 7?

Approved.  Do you have access to the repository, or would you like me to apply the patch for you ?

Cheers
  Nick
Oleg Endo Jan. 11, 2018, 3:18 p.m. | #2
On Thu, 2018-01-11 at 15:10 +0000, Nick Clifton wrote:

> > OK for trunk and GCC 7?
> Approved.  Do you have access to the repository, or would you like me
> to apply the patch for you ?

Thanks.  Committed as r256536 (trunk) and r256538 (GCC 7).

Cheers,
Oleg

Patch

Index: gcc/config/rx/rx.md
===================================================================
--- gcc/config/rx/rx.md	(revision 256385)
+++ 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")]
 )