https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111870
--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> --- If I change your testcase to be: uint64_t huh2 (_Atomic(uint64_t)* map, int t) { return atomic_fetch_or_explicit(map, t, memory_order_relaxed); } You will see that it does the `lock cmpxchg` loop too.