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.