tree, int *, int);
static tree mips_build_builtin_va_list (void);
static tree mips_gimplify_va_arg_expr (tree, tree, tree *, tree *);
+static bool mips_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode mode,
+ tree, bool);
#if TARGET_IRIX
static void irix_asm_named_section_1 (const char *, unsigned int,
#define TARGET_STRICT_ARGUMENT_NAMING mips_strict_argument_naming
#undef TARGET_MUST_PASS_IN_STACK
#define TARGET_MUST_PASS_IN_STACK must_pass_in_stack_var_size
+#undef TARGET_PASS_BY_REFERENCE
+#define TARGET_PASS_BY_REFERENCE mips_pass_by_reference
struct gcc_target targetm = TARGET_INITIALIZER;
\f
tree addr;
bool indirect;
- indirect
- = function_arg_pass_by_reference (NULL, TYPE_MODE (type), type, 0);
+ indirect = pass_by_reference (NULL, TYPE_MODE (type), type, 0);
if (indirect)
type = build_pointer_type (type);
return gen_rtx_REG (mode, GP_RETURN);
}
-/* The implementation of FUNCTION_ARG_PASS_BY_REFERENCE. Return
- nonzero when an argument must be passed by reference. */
+/* Return nonzero when an argument must be passed by reference. */
-int
-function_arg_pass_by_reference (const CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED,
- enum machine_mode mode, tree type,
- int named ATTRIBUTE_UNUSED)
+static bool
+mips_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED,
+ enum machine_mode mode, tree type,
+ bool named ATTRIBUTE_UNUSED)
{
if (mips_abi == ABI_EABI)
{
if (type == NULL_TREE || mode == DImode || mode == DFmode)
return 0;
- size = int_size_in_bytes (type);
+ if (type)
+ size = int_size_in_bytes (type);
+ else
+ size = GET_MODE_SIZE (mode);
+
return size == -1 || size > UNITS_PER_WORD;
}
else