public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-9536] alpha: Fix alpha_setup_incoming_varargs [PR114175]
@ 2024-03-19  8:15 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2024-03-19  8:15 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:a185d8aeeed7a25a01505565aa61ccf8a876c6ff

commit r14-9536-ga185d8aeeed7a25a01505565aa61ccf8a876c6ff
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Mar 19 09:14:11 2024 +0100

    alpha: Fix alpha_setup_incoming_varargs [PR114175]
    
    Like in the r14-9503 change on x86-64, I think Alpha also needs to
    function_arg_advance after the hidden return pointer argument if
    any.
    At least, the following patch changes the assembly of s1-s6 functions
    on the https://gcc.gnu.org/pipermail/gcc-patches/2024-March/647956.html
    c23-stdarg-9.c testcase, and eyeballing the assembly for int f8 (...)
    the ... args are passed in 16..21 registers and then on the stack,
    while for struct S s8 (...) have hidden return pointer passed in 16
    register and ... args in 17..21 registers and then on the stack, and
    seems without this patch the incoming varargs setup does the wrong thing
    (but I can't test on alpha easily).
    
    Many targets seem to be unaffected, e.g. aarch64, arm, s390*, so I'm not
    trying to change all targets together because such a change clearly isn't
    needed e.g. for targets which use special register for the hidden return
    pointer.
    
    2024-03-19  Jakub Jelinek  <jakub@redhat.com>
    
            PR target/114175
            * config/alpha/alpha.cc (alpha_setup_incoming_varargs): Only skip
            function_arg_advance for TYPE_NO_NAMED_ARGS_STDARG_P functions
            if arg.type is NULL.

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

diff --git a/gcc/config/alpha/alpha.cc b/gcc/config/alpha/alpha.cc
index 98df142fb06..1126cea1f7b 100644
--- a/gcc/config/alpha/alpha.cc
+++ b/gcc/config/alpha/alpha.cc
@@ -6090,7 +6090,8 @@ alpha_setup_incoming_varargs (cumulative_args_t pcum,
 {
   CUMULATIVE_ARGS cum = *get_cumulative_args (pcum);
 
-  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)
     /* Skip the current argument.  */
     targetm.calls.function_arg_advance (pack_cumulative_args (&cum), arg);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-03-19  8:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-19  8:15 [gcc r14-9536] alpha: Fix alpha_setup_incoming_varargs [PR114175] Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).