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

Florian Weimer <fw at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |NEW
   Last reconfirmed|                            |2018-03-29
         Resolution|INVALID                     |---
     Ever confirmed|0                           |1

--- Comment #11 from Florian Weimer <fw at gcc dot gnu.org> ---
We do have a bug here: libatomic selects CMPXCHG16B based on CPUID support.  If
we want to support loads from read-only mappings, we cannot do that, and have
to use locks unconditionally (for all 128-bit atomics, to achieve
synchronization).

So we either need to fix libatomic to use locks consistently, or -mcx16 should
enable the 128 bit CAS instruction (for loads/stores/CAS).

I believe most users who use the 128-bit atomics on x86-64 will want the
lock-free instructions, and not the support for read-only mappings.

Furthermore, the read-only mapping case is most relevant to cross-process
synchronization, and a process-local lock will not achieve synchronization
there.

Reply via email to