diff mbox series

[committed] ft32: Fix up ft32_setup_incoming_varargs [PR114175]

Message ID ZfsJVt4JH3K3CFHv@tucnak
State New
Headers show
Series [committed] ft32: Fix up ft32_setup_incoming_varargs [PR114175] | expand

Commit Message

Jakub Jelinek March 20, 2024, 4:05 p.m. UTC
Hi!

Like for x86-64, alpha or rs6000, ft32 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/ft32/ft32.cc (ft32_setup_incoming_varargs): Only skip
	function arg advance for TYPE_NO_NAMED_ARGS_STDARG_P functions
	if arg.type is NULL.


	Jakub

Comments

Jeff Law March 20, 2024, 5:01 p.m. UTC | #1
On 3/20/24 10:05 AM, Jakub Jelinek wrote:
> Hi!
> 
> Like for x86-64, alpha or rs6000, ft32 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/ft32/ft32.cc (ft32_setup_incoming_varargs): Only skip
> 	function arg advance for TYPE_NO_NAMED_ARGS_STDARG_P functions
> 	if arg.type is NULL.
Built fine.  No gdbsim on this platform, so no execution test data.

jeff
diff mbox series

Patch

--- gcc/config/ft32/ft32.cc.jj	2024-01-03 12:01:22.988486000 +0100
+++ gcc/config/ft32/ft32.cc	2024-03-20 16:11:41.804969813 +0100
@@ -635,9 +635,10 @@  ft32_setup_incoming_varargs (cumulative_
 {
   CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v);
   int named_size = 0;
-  if (!TYPE_NO_NAMED_ARGS_STDARG_P (TREE_TYPE (current_function_decl)))
-    named_size =
-      GET_MODE_SIZE (SImode) * (*cum - FT32_R0) + GET_MODE_SIZE (arg.mode);
+  if (!TYPE_NO_NAMED_ARGS_STDARG_P (TREE_TYPE (current_function_decl))
+      || arg.type != NULL_TREE)
+    named_size
+      = GET_MODE_SIZE (SImode) * (*cum - FT32_R0) + GET_MODE_SIZE (arg.mode);
 
   if (named_size < 24)
     *pretend_size = 24 - named_size;