https://gcc.gnu.org/g:4c9d2810908004b7e04599b426aca5ee1bd16735
commit r14-9578-g4c9d2810908004b7e04599b426aca5ee1bd16735 Author: Jakub Jelinek <ja...@redhat.com> Date: Wed Mar 20 17:00:08 2024 +0100 nios2: Fix up nios2_setup_incoming_varargs [PR114175] Like for x86-64, alpha or rs6000, nios2 seems to be affected too. Just visually checked differences in c23-stdarg-9.c assembly in a cross without/with the patch, committed to trunk. 2024-03-20 Jakub Jelinek <ja...@redhat.com> PR target/114175 * config/nios2/nios2.cc (nios2_setup_incoming_varargs): Only skip nios2_function_arg_advance for TYPE_NO_NAMED_ARGS_STDARG_P functions if arg.type is NULL. Diff: --- gcc/config/nios2/nios2.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/config/nios2/nios2.cc b/gcc/config/nios2/nios2.cc index fba13c34dae..a981e5095ef 100644 --- a/gcc/config/nios2/nios2.cc +++ b/gcc/config/nios2/nios2.cc @@ -3525,7 +3525,8 @@ nios2_setup_incoming_varargs (cumulative_args_t cum_v, cfun->machine->uses_anonymous_args = 1; local_cum = *cum; - if (!TYPE_NO_NAMED_ARGS_STDARG_P (TREE_TYPE (current_function_decl))) + if (!TYPE_NO_NAMED_ARGS_STDARG_P (TREE_TYPE (current_function_decl)) + || arg.type != NULL_TREE) nios2_function_arg_advance (local_cum_v, arg); regs_to_push = NUM_ARG_REGS - local_cum.regs_used;