]> git.ipfire.org Git - thirdparty/gcc.git/commit
mips: Fix C23 (...) functions returning large aggregates [PR114175]
authorXi Ruoyao <xry111@xry111.site>
Wed, 20 Mar 2024 07:09:21 +0000 (15:09 +0800)
committerXi Ruoyao <xry111@xry111.site>
Sat, 30 Mar 2024 05:45:36 +0000 (13:45 +0800)
commit1ab646f678a9d47b338424ed69e9ae5d774b06ae
tree99a65411735d21e93594cee7f4d0aa38d3fffe98
parentb73a6a20113ca607cf3073c751698b12aa167881
mips: 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,8,9}.c to
fail.

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

gcc/ChangeLog:

PR target/114175
* config/mips/mips.cc (mips_setup_incoming_varargs): Only skip
mips_function_arg_advance for TYPE_NO_NAMED_ARGS_STDARG_P
functions if arg.type is NULL.

(cherry picked from commit 6fc84f680d098f82c1c43435fdb206099f0df4df)
gcc/config/mips/mips.cc