https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57448
Alexander Monakov <amonakov at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED CC| |amonakov at gcc dot gnu.org Resolution|--- |FIXED --- Comment #4 from Alexander Monakov <amonakov at gcc dot gnu.org> --- This should now be fixed on the trunk, although in a very different manner: RTL expansion of atomic loads/stores now places explicit compiler memory barriers in the form of asm volatile ("" ::: "memory") before/after the access as appropriate. My patch submission said, There's ALIAS_SET_MEMORY_BARRIER placed on MEMs accessed via atomics, but it's probably not useful, it's very hard to audit all RTL passes and ensure they respect it. On the other hand, asm barriers must work or else much of real-world code will break.