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

torvald at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |torvald at gcc dot gnu.org

--- Comment #6 from torvald at gcc dot gnu.org ---
I think tbegin needs to have same semantics as a lock acquisition and the
compiler must not assume to know anything about tbegin's return value; tend
must have same semantics as a lock release.

See the libc-alpha discussion for why I think this is the case:
https://sourceware.org/ml/libc-alpha/2015-08/msg00963.html

Thus, I don't think a full compiler barrier is necessary, but if we don't have
something finer-grained to capture the semantics of a lock acquisition, then we
need the compiler barrier (GCC currently assumes atomics to be compiler
barriers AFAIK).  We should in any case agree on a semantics and document it in
the GCC sources.  Documenting that we need a full compiler barrier is not
correct in that it's not a necessary condition (even though it should be a
sufficient condition).

Reply via email to