https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99531
Bug ID: 99531
Summary: Performance regression since gcc 9 (argument passing /
register allocation)
Product: gcc
Version: 10.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: stefanrin at gmail dot com
Target Milestone: ---
Target: x86_64
For this source:
int func(int, int, int, int, int, int);
int caller(int a, int b, int c, int d, int e) { return func(0, a, b, c, d, e);
}
the code generated for caller is:
pushq %r12
movl %r8d, %r9d
popq %r12
movl %ecx, %r8d
movl %edx, %ecx
movl %esi, %edx
movl %edi, %esi
xorl %edi, %edi
jmp func
gcc 9 started producing the useless push/pop pair.
Mailing list link:
https://gcc.gnu.org/pipermail/gcc-help/2021-February/139885.html