https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59767
Andrew Macleod <amacleod at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |amacleod at redhat dot com
--- Comment #2 from Andrew Macleod <amacleod at redhat dot com> ---
I do not believe the lock is needed. See
https://www.cl.cam.ac.uk/~pes20/cpp/cpp0xmappings.html
GCC will emit the fence on all stores which then synchronize with loads. If we
did emit a fence on the loads, then we wouldn't need the fence on stores. It
is likely there will be more loads than stores, so the current approach is
usually more efficient.