This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/65697] __atomic memory barriers not strong enough for __sync builtins


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

--- Comment #15 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to mwahab from comment #14)
> The LDAXR/STLXR sequences rely on the C11/C++11 prohibition of data races.
> That the __atomic builtins assume this restriction is implied by the
> references to C11/C++11 in the documentation but should probably be made
> clearer. I'll try to write a patch, if nobody else gets there first.

The __atomic builtins are used far more widely than just as the underlying
implementation for C11/C++11 atomics.  And, even on very weakly ordered
architectures like PowerPC, __atomic_ CAS __ATOMIC_SEQ_CST emits a sync (full
barrier) before the LL/SC loop and isync after the loop, so it behaves as
documented currently.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]