Hi!

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.

--- gcc/config/nios2/nios2.cc.jj        2024-01-03 12:01:15.414592108 +0100
+++ gcc/config/nios2/nios2.cc   2024-03-20 16:14:07.051020226 +0100
@@ -3525,7 +3525,8 @@ nios2_setup_incoming_varargs (cumulative
 
   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;

        Jakub

Reply via email to