[Bug target/80878] -mcx16 (enable 128 bit CAS) on x86_64 seems not to work on 7.1.0

fw at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Mar 29 18:36:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80878

--- Comment #16 from Florian Weimer <fw at gcc dot gnu.org> ---
(In reply to andysem from comment #12)
> Is read-only memory a valid use case for __atomic intrinsics anyway? These
> intrinsics are primarily targeted to implement std::atomic,

I strongly disagree about that.  These intrinsics are used in many other
contexts.

> but does the
> standard guarantee these operations (primarily, std::atomic::load()) do not
> issue writes to the memory?

std::atomic objects need to be placed in memory which allows CAS to work (or
whatever is used for the loads).  On some architectures, there are more
constraints than just read-only vs writable.  I don't know if libstdc++ ensures
that in some way; due the constexpr constructor, this could be tricky.


More information about the Gcc-bugs mailing list