https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80817
--- Comment #4 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
On 32-bit x86 manipulating 64-bit integers, let alone atomically, is going to
be inconvenient. The emitted code could have been shorter, instead of
movl (%esp), %eax
movl 4(%esp), %edx
addl $1, %eax
adcl $0, %edx
movl %eax, (%esp)
movl %edx, 4(%esp)
it would be sufficient to emit
addl $1, (%esp)
adcl $0, 4(%esp)
(it seems stack slots holding the loaded value have been made volatile,
wrongly?), and with -msse2 it could have used SSE load/add/store, but that
needs enhancements in the STV pass I guess.