diff mbox series

[committed] epiphany: Fix up epiphany_setup_incoming_varargs [PR114175]

Message ID ZfsJMbMOyCkl7DK5@tucnak
State New
Headers show
Series [committed] epiphany: Fix up epiphany_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, 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.


	Jakub

Comments

Jeff Law March 20, 2024, 4:59 p.m. UTC | #1
On 3/20/24 10:05 AM, Jakub Jelinek wrote:
> Hi!
> 
> 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.
Built fine.  Platform has been too flakey to run tests with any 
consistency.  So no real test results.

jeff
diff mbox series

Patch

--- gcc/config/epiphany/epiphany.cc.jj	2024-01-03 11:51:47.401510931 +0100
+++ gcc/config/epiphany/epiphany.cc	2024-03-20 16:10:08.152226880 +0100
@@ -728,7 +728,8 @@  epiphany_setup_incoming_varargs (cumulat
     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;