https://gcc.gnu.org/g:01397f789866198ad4fae3893d8f6b0a1d96cd96

commit r13-8519-g01397f789866198ad4fae3893d8f6b0a1d96cd96
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Wed Mar 20 17:00:51 2024 +0100

    visium: Fix up visium_setup_incoming_varargs [PR114175]
    
    Like for x86-64, alpha or rs6000, visium 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/visium/visium.cc (visium_setup_incoming_varargs): Only skip
            TARGET_FUNCTION_ARG_ADVANCE for TYPE_NO_NAMED_ARGS_STDARG_P 
functions
            if arg.type is NULL.
    
    (cherry picked from commit b05ee9b69e4644cefbb94a768c4ea302fd44b934)

Diff:
---
 gcc/config/visium/visium.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/config/visium/visium.cc b/gcc/config/visium/visium.cc
index ec4c2e9ae5c..1f9ce9b9fcd 100644
--- a/gcc/config/visium/visium.cc
+++ b/gcc/config/visium/visium.cc
@@ -1481,7 +1481,8 @@ visium_setup_incoming_varargs (cumulative_args_t pcum_v,
   /* The caller has advanced ARGS_SO_FAR up to, but not beyond, the last named
      argument.  Advance a local copy of ARGS_SO_FAR past the last "real" named
      argument, to find out how many registers are left over.  */
-  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)
     TARGET_FUNCTION_ARG_ADVANCE (local_args_so_far, arg);
 
   /* Find how many registers we need to save.  */

Reply via email to