https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104928
--- Comment #4 from Nate Eldredge <nate at thatsmathematics dot com> --- @Jonathan: I think that patch set is on the right track, but it has some other serious bugs. For one, __atomic_wait_address calls __detail::__wait_impl with __args._M_old uninitialized (g++ -O3 -Wall catches it). There is another uninitialized warning about __wait_addr that I haven't yet confirmed. Lastly, in __wait_impl, there is a test `if (__args & __wait_flags::__spin_only)`, but __spin_only has two bits set, one of which is __do_spin. So in effect, __do_spin (which is set by default on Linux) is taken to imply __spin_only, with the result that it *only* ever spins, without ever sleeping. Thus every semaphore (and maybe other waits too) becomes a spinlock, which is Not Good. Should I take this up on gcc-patches, or elsewhere?