]> git.ipfire.org Git - thirdparty/gcc.git/commit
alpha: Fix alpha_setup_incoming_varargs [PR114175]
authorJakub Jelinek <jakub@redhat.com>
Tue, 19 Mar 2024 08:14:11 +0000 (09:14 +0100)
committerJakub Jelinek <jakub@redhat.com>
Tue, 19 Mar 2024 08:14:11 +0000 (09:14 +0100)
commita185d8aeeed7a25a01505565aa61ccf8a876c6ff
tree8987451c12c0e84f95673999d124b1854df0567c
parent8f85b46337f90c3126b9cefd72ffd29eb9a4ebf3
alpha: Fix alpha_setup_incoming_varargs [PR114175]

Like in the r14-9503 change on x86-64, I think Alpha also needs to
function_arg_advance after the hidden return pointer argument if
any.
At least, the following patch changes the assembly of s1-s6 functions
on the https://gcc.gnu.org/pipermail/gcc-patches/2024-March/647956.html
c23-stdarg-9.c testcase, and eyeballing the assembly for int f8 (...)
the ... args are passed in 16..21 registers and then on the stack,
while for struct S s8 (...) have hidden return pointer passed in 16
register and ... args in 17..21 registers and then on the stack, and
seems without this patch the incoming varargs setup does the wrong thing
(but I can't test on alpha easily).

Many targets seem to be unaffected, e.g. aarch64, arm, s390*, so I'm not
trying to change all targets together because such a change clearly isn't
needed e.g. for targets which use special register for the hidden return
pointer.

2024-03-19  Jakub Jelinek  <jakub@redhat.com>

PR target/114175
* config/alpha/alpha.cc (alpha_setup_incoming_varargs): Only skip
function_arg_advance for TYPE_NO_NAMED_ARGS_STDARG_P functions
if arg.type is NULL.
gcc/config/alpha/alpha.cc