https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35646
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |11.0
Resolution|--- |FIXED
Status|NEW |RESOLVED
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed in GCC 11 at least.
add:
movl %edi, %eax
addl %esi, %eax
jc .L10
ret
.L10:
pushq %rax
xorl %edi, %edi
call exit
.cfi_endproc
.LFE13:
.size add, .-add
.p2align 4
.globl addto
.type addto, @function
addto:
addl %esi, (%rdi)
jc .L18
ret
.L18:
subq $8, %rsp
xorl %edi, %edi
call exit
---- CUT ----
Note GCC 7 almost gets it right for both
add:
addl %esi, %edi
jc .L10
movl %edi, %eax
ret
.L10:
subq $8, %rsp
xorl %edi, %edi
call exit@PLT
addto:
xorl %eax, %eax
addl (%rdi), %esi
setc %al
movl %esi, (%rdi)
testl %eax, %eax
jne .L18
rep ret
.L18:
subq $8, %rsp
xorl %edi, %edi
call exit@PLT