===================================================================
@@ -28,6 +28,7 @@ extern bool gimple_alloca_call_p (const
extern bool alloca_call_p (const_tree);
extern bool must_pass_in_stack_var_size (machine_mode, const_tree);
extern bool must_pass_in_stack_var_size_or_pad (machine_mode, const_tree);
+extern bool must_pass_va_arg_in_stack (tree);
extern rtx prepare_call_address (tree, rtx, rtx, rtx *, int, int);
extern bool shift_return_value (machine_mode, bool, rtx);
extern rtx expand_call (tree, rtx, int);
===================================================================
@@ -5900,5 +5900,14 @@ must_pass_in_stack_var_size_or_pad (mach
return false;
}
+/* Return true if TYPE must be passed on the stack when passed to
+ the "..." arguments of a function. */
+
+bool
+must_pass_va_arg_in_stack (tree type)
+{
+ return targetm.calls.must_pass_in_stack (TYPE_MODE (type), type);
+}
+
/* Tell the garbage collector about GTY markers in this source file. */
#include "gt-calls.h"
===================================================================
@@ -6243,7 +6243,7 @@ alpha_gimplify_va_arg_1 (tree type, tree
/* If the type could not be passed in registers, skip the block
reserved for the registers. */
- if (targetm.calls.must_pass_in_stack (TYPE_MODE (type), type))
+ if (must_pass_va_arg_in_stack (type))
{
t = build_int_cst (TREE_TYPE (offset), 6*8);
gimplify_assign (offset,
===================================================================
@@ -7656,9 +7656,8 @@ sh_gimplify_va_arg_expr (tree valist, tr
tree addr, lab_over = NULL, result = NULL;
tree eff_type;
- const bool pass_by_ref =
- !VOID_TYPE_P (type)
- && targetm.calls.must_pass_in_stack (TYPE_MODE (type), type);
+ const bool pass_by_ref
+ = !VOID_TYPE_P (type) && must_pass_va_arg_in_stack (type);
if (pass_by_ref)
type = build_pointer_type (type);
===================================================================
@@ -1342,7 +1342,7 @@ xstormy16_gimplify_va_arg_expr (tree val
count = build3 (COMPONENT_REF, TREE_TYPE (f_count), valist, f_count,
NULL_TREE);
- must_stack = targetm.calls.must_pass_in_stack (TYPE_MODE (type), type);
+ must_stack = must_pass_va_arg_in_stack (type);
size_tree = round_up (size_in_bytes (type), UNITS_PER_WORD);
gimplify_expr (&size_tree, pre_p, NULL, is_gimple_val, fb_rvalue);
===================================================================
@@ -3328,7 +3328,7 @@ xtensa_gimplify_va_arg_expr (tree valist
array = create_tmp_var (ptr_type_node);
lab_over = NULL;
- if (!targetm.calls.must_pass_in_stack (TYPE_MODE (type), type))
+ if (!must_pass_va_arg_in_stack (type))
{
lab_false = create_artificial_label (UNKNOWN_LOCATION);
lab_over = create_artificial_label (UNKNOWN_LOCATION);