https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123506
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2026-01-14
Ever confirmed|0 |1
Summary|[14/15/16 Regression] Some |[14/15/16 Regression] Some
|unnecessary assembly |unnecessary assembly
|generated in simple |generated in simple
|function |function since r14-2386 &
| |r14-2526
CC| |sayle at gcc dot gnu.org
Keywords|needs-bisection |
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
This first changed in r14-2386-gbdf2737cda53a83332db1a1a021653447b05a7e7, from
movl %esi, %eax
movl $11621, %edx
testl %esi, %esi
jns .L2
negl %eax
movl $11109, %edx
.L2:
movw %dx, (%rdi)
leaq 2(%rdi), %rdx
to
movl $11621, %eax
testl %esi, %esi
jns .L2
negl %esi
movl $11109, %eax
.L2:
xorl %r8d, %r8d
movw %ax, (%rdi)
movl %esi, %esi
addq $2, %rdi
movabsq $-4294967296, %rdx
movq %r8, %rax
andq %rdx, %rax
movq %rdi, %rdx
orq %rsi, %rax
and then in r14-2526-g8911879415d6c2a7baad88235554a912887a1c5c to
movl $11621, %eax
testl %esi, %esi
jns .L2
negl %esi
movl $11109, %eax
.L2:
movw %ax, (%rdi)
movl %esi, %esi
addq $2, %rdi
movq %rdi, %rdx
movq %rsi, %rax
which is roughly what is emitted until today, with the only difference
- movq %rsi, %rax
+ movl %esi, %eax
Though sure, when using the movl at the end the movl %esi, %esi earlier makes
no sense.