https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103069
H.J. Lu <hjl.tools at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |NEW --- Comment #9 from H.J. Lu <hjl.tools at gmail dot com> --- nptl/nptl_setxid.c in glibc has do { flags = THREAD_GETMEM (self, cancelhandling); newval = THREAD_ATOMIC_CMPXCHG_VAL (self, cancelhandling, flags & ~SETXID_BITMASK, flags); } while (flags != newval); GCC 12 generates: 899f0: 64 8b 14 25 08 03 00 mov %fs:0x308,%edx 899f8: 89 d6 mov %edx,%esi 899fa: 89 d0 mov %edx,%eax 899fc: 83 e6 bf and $0xffffffbf,%esi 899ff: f0 0f b1 31 lock cmpxchg %esi,(%rcx) 89a03: 75 eb jne 899f0 <__GI___nptl_setxid_sighand ler+0x90>