]> git.ipfire.org Git - thirdparty/gcc.git/commit
LoongArch: Fix C23 (...) functions returning large aggregates [PR114175]
authorXi Ruoyao <xry111@xry111.site>
Mon, 18 Mar 2024 09:18:34 +0000 (17:18 +0800)
committerXi Ruoyao <xry111@xry111.site>
Sat, 30 Mar 2024 05:45:13 +0000 (13:45 +0800)
commitb73a6a20113ca607cf3073c751698b12aa167881
tree2de99721c49107e8a87e18367b05061e2e95c856
parentb7b4ef2ff20c5023a41ed663dd8f4724b4ff0f9c
LoongArch: Fix C23 (...) functions returning large aggregates [PR114175]

We were assuming TYPE_NO_NAMED_ARGS_STDARG_P don't have any named
arguments and there is nothing to advance, but that is not the case
for (...) functions returning by hidden reference which have one such
artificial argument.  This is causing gcc.dg/c23-stdarg-6.c and
gcc.dg/c23-stdarg-8.c to fail.

Fix the issue by checking if arg.type is NULL, as r14-9503 explains.

gcc/ChangeLog:

PR target/114175
* config/loongarch/loongarch.cc
(loongarch_setup_incoming_varargs): Only skip
loongarch_function_arg_advance for TYPE_NO_NAMED_ARGS_STDARG_P
functions if arg.type is NULL.

(cherry picked from commit c1fd4589c2bf9fd8409d51b94df219cb75107762)
gcc/config/loongarch/loongarch.cc