About machine description for atomic_exchange

Andrew Haley aph@redhat.com
Fri Sep 13 08:15:00 GMT 2019


On 9/12/19 4:04 PM, William Tambe wrote:
> Is there an example, not necessarily for atomic_exchange, that I can follow ?
> 
> Also, is this behavior related to GCC memory model ? ie:
> (MEM_VOLATILE_P (operands[1])) for atomic_exchange always TRUE
> regardless of whether the memory operand was declared using
> "volatile"

I've been thinking about this, and have been unable to come up with a
use for a non-volatile atomic_exchange. If you had such a thing you'd
also have undefined behaviour if an other thread accessed the operand
racily.

-- 
Andrew Haley  (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671



More information about the Gcc-help mailing list