https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119174
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Last reconfirmed| |2025-03-09
Keywords| |missed-optimization
Status|UNCONFIRMED |NEW
--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note the same effect can be seen on aarch64 (though not the wrong code part due
to reload vs LRA):
Popping a3(r109,l0) -- assign reg 1
And then getting:
.L2:
cmp w20, w19
bgt .L3
ldp x19, x20, [sp, 16]
ldp x29, x30, [sp], 48
ret
.L3:
.cfi_restore_state
ldr x2, [x1, x19, lsl 3]
str x1, [sp, 40]
add x19, x19, 1
blr x2
ldr x1, [sp, 40]
b .L2
See the spill around the call.