https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87206
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
Last reconfirmed| |2021-12-21
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.
Note GCC does produce better code than LLVM which produces two branches:
mov ecx, 1
xor eax, eax
lock cmpxchg dword ptr [rdi], ecx
je .LBB0_2
# %bb.1:
test eax, eax
je .LBB0_2
# %bb.3:
jmp bar # TAILCALL
.LBB0_2:
ret