[committed] m32r: Fix up m32r_setup_incoming_varargs [PR114175]

Jakub Jelinek jakub@redhat.com
Wed Mar 20 16:06:18 GMT 2024


Hi!

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

--- gcc/config/m32r/m32r.cc.jj	2024-01-03 11:51:50.204472028 +0100
+++ gcc/config/m32r/m32r.cc	2024-03-20 16:12:15.841512952 +0100
@@ -1287,7 +1287,8 @@ m32r_setup_incoming_varargs (cumulative_
   if (!TYPE_NO_NAMED_ARGS_STDARG_P (TREE_TYPE (current_function_decl)))
     gcc_assert (arg.mode != BLKmode);
 
-  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)
     first_anon_arg = (ROUND_ADVANCE_CUM (*get_cumulative_args (cum),
 					 arg.mode, arg.type)
 		      + ROUND_ADVANCE_ARG (arg.mode, arg.type));

	Jakub



More information about the Gcc-patches mailing list