https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114865
--- Comment #23 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Jonathan Wakely from comment #22) > I'm not sure how to fix that problem without pessimizing every > std::atomic<T>::compare_exchange_strong to use the looping implementation To be clear, not *every* compare exchange, only when T has padding bits. Which suggests you would get better perf by defining your type to have no padding bits: struct state_type { std::uint64_t timestamp; std::uint16_t clock_seq; char unused[6]; };