]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
epiphany: Fix up epiphany_setup_incoming_varargs [PR114175]
authorJakub Jelinek <jakub@redhat.com>
Wed, 20 Mar 2024 15:59:21 +0000 (16:59 +0100)
committerJakub Jelinek <jakub@redhat.com>
Wed, 20 Mar 2024 15:59:21 +0000 (16:59 +0100)
Like for x86-64, alpha or rs6000, epiphany 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  <jakub@redhat.com>

PR target/114175
* config/epiphany/epiphany.cc (epiphany_setup_incoming_varargs): Only
skip function arg advance for TYPE_NO_NAMED_ARGS_STDARG_P functions
if arg.type is NULL.

gcc/config/epiphany/epiphany.cc

index d6c057f1685b178617a23d8516a97e707139f005..79254c2025429e695082c66e784bf17d502cca01 100644 (file)
@@ -728,7 +728,8 @@ epiphany_setup_incoming_varargs (cumulative_args_t cum,
     gcc_assert (arg.mode != BLKmode);
 
   next_cum = *get_cumulative_args (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)
     next_cum = (ROUND_ADVANCE_CUM (next_cum, arg.mode, arg.type)
                + ROUND_ADVANCE_ARG (arg.mode, arg.type));
   first_anon_arg = next_cum;