https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80640
--- Comment #5 from Alexander Monakov <amonakov at gcc dot gnu.org> --- I think the bug is that on x86 __atomic_thread_fence(x) is expanded into nothing for x!=__ATOMIC_SEQ_CST, it should place a compiler barrier similar to expansion of __atomic_signal_fence.