* calls.c (compute_argument_block_size): Add argument tree fndecl.
(OUTGOING_REG_PARM_STACK_SPACE): Add function type argument.
(emit_library_call_value_1): Add new variable fndecl initialized by
NULL_TREE. It should be the decl type of orgfun, but this information
seems not to be available here, so it uses the default calling abi.
* config/arm/arm.c (arm_return_in_memory): Add fntype argumen.
* config/arm/arm.h (RETURN_IN_MEMORY): Replace RETURN_IN_MEMORY
by TARGET_RETURN_IN_MEMORY.
* config/i386/i386-interix.h: Likewise.
* config/i386/i386.h: Likewise.
* config/i386/i386elf.h: Likewise.
* config/i386/ptx4-i.h: Likewise.
* config/i386/sol2-10.h: Likewise.
* config/i386/sysv4.h: Likewise.
* config/i386/vx-common.h: Likewise.
* config/cris/cris.h: Removed #if 0 clause.
* config/arm/arm-protos.h (arm_return_in_memory): Add fntype
argument.
* config/i386/i386-protos.h (ix86_return_in_memory): Add fntype
argument.
(ix86_sol10_return_in_memory): Likewise.
(ix86_i386elf_return_in_memory): New.
(ix86_i386interix_return_in_memory): New.
* config/mt/mt-protos.h (mt_return_in_memory): New.
* config/mt/mt.c: Likewise.
* config/mt/mt.h (OUTGOING_REG_PARM_STACK_SPACE): Add FNTYPE argument.
(RETURN_IN_MEMORY): Replace by TARGET_RETURN_IN_MEMORY.
* config/bfin/bfin.h: Likewise.
* config/bfin/bfin-protos.h (bfin_return_in_memory): Add fntype
argument.
* config/bfin/bfin.c: Likewise.
* config/pa/pa.h (OUTGOING_REG_PARM_STACK_SPACE): Add FNTYPE argument.
* config/alpha/unicosmk.h: Likewise.
* config/i386/cygming.h: Likewise.
* config/iq2000/iq2000.h: Likewise.
* config/mips/mips.h: Likewise.
* config/mn10300/mn10300.h: Likewise.
* config/rs6000/rs6000.h: Likewise.
* config/score/score.h: Likewise.
* config/spu/spu.h: Likewise.
* config/v850/v850.h: Likewise.
* defaults.h: Likewise.
* doc/tm.texi (OUTGOING_REG_PARM_STACK_SPACE): Adjust documentation.
* expr.c (emit_block_move): Adjust use of OUTGOING_REG_PARM_STACK_SPACE.
* function.c (STACK_DYNAMIC_OFFSET): Adjust use of
OUTGOING_REG_PARM_STACK_SPACE.
* targhooks.c (default_return_in_memory): Remove RETURN_IN_MEMORY.
From-SVN: r135069
+2008-05-08 Kai Tietz <kai,tietz@onevision.com>
+
+ * calls.c (compute_argument_block_size): Add argument tree fndecl.
+ (OUTGOING_REG_PARM_STACK_SPACE): Add function type argument.
+ (emit_library_call_value_1): Add new variable fndecl initialized by
+ NULL_TREE. It should be the decl type of orgfun, but this information
+ seems not to be available here, so it uses the default calling abi.
+ * config/arm/arm.c (arm_return_in_memory): Add fntype argumen.
+ * config/arm/arm.h (RETURN_IN_MEMORY): Replace RETURN_IN_MEMORY
+ by TARGET_RETURN_IN_MEMORY.
+ * config/i386/i386-interix.h: Likewise.
+ * config/i386/i386.h: Likewise.
+ * config/i386/i386elf.h: Likewise.
+ * config/i386/ptx4-i.h: Likewise.
+ * config/i386/sol2-10.h: Likewise.
+ * config/i386/sysv4.h: Likewise.
+ * config/i386/vx-common.h: Likewise.
+ * config/cris/cris.h: Removed #if 0 clause.
+ * config/arm/arm-protos.h (arm_return_in_memory): Add fntype
+ argument.
+ * config/i386/i386-protos.h (ix86_return_in_memory): Add fntype
+ argument.
+ (ix86_sol10_return_in_memory): Likewise.
+ (ix86_i386elf_return_in_memory): New.
+ (ix86_i386interix_return_in_memory): New.
+ * config/mt/mt-protos.h (mt_return_in_memory): New.
+ * config/mt/mt.c: Likewise.
+ * config/mt/mt.h (OUTGOING_REG_PARM_STACK_SPACE): Add FNTYPE argument.
+ (RETURN_IN_MEMORY): Replace by TARGET_RETURN_IN_MEMORY.
+ * config/bfin/bfin.h: Likewise.
+ * config/bfin/bfin-protos.h (bfin_return_in_memory): Add fntype
+ argument.
+ * config/bfin/bfin.c: Likewise.
+ * config/pa/pa.h (OUTGOING_REG_PARM_STACK_SPACE): Add FNTYPE argument.
+ * config/alpha/unicosmk.h: Likewise.
+ * config/i386/cygming.h: Likewise.
+ * config/iq2000/iq2000.h: Likewise.
+ * config/mips/mips.h: Likewise.
+ * config/mn10300/mn10300.h: Likewise.
+ * config/rs6000/rs6000.h: Likewise.
+ * config/score/score.h: Likewise.
+ * config/spu/spu.h: Likewise.
+ * config/v850/v850.h: Likewise.
+ * defaults.h: Likewise.
+ * doc/tm.texi (OUTGOING_REG_PARM_STACK_SPACE): Adjust documentation.
+ * expr.c (emit_block_move): Adjust use of OUTGOING_REG_PARM_STACK_SPACE.
+ * function.c (STACK_DYNAMIC_OFFSET): Adjust use of
+ OUTGOING_REG_PARM_STACK_SPACE.
+ * targhooks.c (default_return_in_memory): Remove RETURN_IN_MEMORY.
+
2008-05-08 Jakub Jelinek <jakub@redhat.com>
* tree-parloops.c (create_parallel_loop): Set OMP_RETURN_NOWAIT
static int finalize_must_preallocate (int, int, struct arg_data *,
struct args_size *);
static void precompute_arguments (int, int, struct arg_data *);
-static int compute_argument_block_size (int, struct args_size *, int);
+static int compute_argument_block_size (int, struct args_size *, tree, int);
static void initialize_argument_information (int, struct arg_data *,
struct args_size *, int,
tree, tree,
static int
compute_argument_block_size (int reg_parm_stack_space,
struct args_size *args_size,
+ tree fndecl,
int preferred_stack_boundary ATTRIBUTE_UNUSED)
{
int unadjusted_args_size = args_size->constant;
/* The area corresponding to register parameters is not to count in
the size of the block we need. So make the adjustment. */
- if (!OUTGOING_REG_PARM_STACK_SPACE)
+ if (! OUTGOING_REG_PARM_STACK_SPACE ((!fndecl ? NULL_TREE : TREE_TYPE (fndecl))))
args_size->var
= size_binop (MINUS_EXPR, args_size->var,
ssize_int (reg_parm_stack_space));
args_size->constant = MAX (args_size->constant,
reg_parm_stack_space);
- if (!OUTGOING_REG_PARM_STACK_SPACE)
+ if (! OUTGOING_REG_PARM_STACK_SPACE ((!fndecl ? NULL_TREE : TREE_TYPE (fndecl))))
args_size->constant -= reg_parm_stack_space;
}
return unadjusted_args_size;
reg_parm_stack_space = REG_PARM_STACK_SPACE (fndecl);
#endif
- if (!OUTGOING_REG_PARM_STACK_SPACE && reg_parm_stack_space > 0 && PUSH_ARGS)
+ if (! OUTGOING_REG_PARM_STACK_SPACE ((!fndecl ? NULL_TREE : TREE_TYPE (fndecl)))
+ && reg_parm_stack_space > 0 && PUSH_ARGS)
must_preallocate = 1;
/* Set up a place to return a structure. */
unadjusted_args_size
= compute_argument_block_size (reg_parm_stack_space,
&adjusted_args_size,
+ fndecl,
(pass == 0 ? 0
: preferred_stack_boundary));
/* Since we will be writing into the entire argument area,
the map must be allocated for its entire size, not just
the part that is the responsibility of the caller. */
- if (!OUTGOING_REG_PARM_STACK_SPACE)
+ if (! OUTGOING_REG_PARM_STACK_SPACE ((!fndecl ? NULL_TREE : TREE_TYPE (fndecl))))
needed += reg_parm_stack_space;
#ifdef ARGS_GROW_DOWNWARD
{
rtx push_size
= GEN_INT (adjusted_args_size.constant
- + (OUTGOING_REG_PARM_STACK_SPACE ? 0
+ + (OUTGOING_REG_PARM_STACK_SPACE ((!fndecl ? NULL
+ : TREE_TYPE (fndecl))) ? 0
: reg_parm_stack_space));
if (old_stack_level == 0)
{
/* If register arguments require space on the stack and stack space
was not preallocated, allocate stack space here for arguments
passed in registers. */
- if (OUTGOING_REG_PARM_STACK_SPACE && !ACCUMULATE_OUTGOING_ARGS
+ if (OUTGOING_REG_PARM_STACK_SPACE ((!fndecl ? NULL_TREE : TREE_TYPE (fndecl)))
+ && !ACCUMULATE_OUTGOING_ARGS
&& must_preallocate == 0 && reg_parm_stack_space > 0)
anti_adjust_stack (GEN_INT (reg_parm_stack_space));
struct args_size original_args_size;
int argnum;
rtx fun;
+ /* Todo, choose the correct decl type of orgfun. Sadly this information
+ isn't present here, so we default to native calling abi here. */
+ tree fndecl = NULL_TREE; /* library calls default to host calling abi ? */
int inc;
int count;
rtx argblock = 0;
args_size.constant = MAX (args_size.constant,
reg_parm_stack_space);
- if (!OUTGOING_REG_PARM_STACK_SPACE)
+ if (! OUTGOING_REG_PARM_STACK_SPACE ((!fndecl ? NULL_TREE : TREE_TYPE (fndecl))))
args_size.constant -= reg_parm_stack_space;
if (args_size.constant > crtl->outgoing_args_size)
/* Since we will be writing into the entire argument area, the
map must be allocated for its entire size, not just the part that
is the responsibility of the caller. */
- if (!OUTGOING_REG_PARM_STACK_SPACE)
+ if (! OUTGOING_REG_PARM_STACK_SPACE ((!fndecl ? NULL_TREE : TREE_TYPE (fndecl))))
needed += reg_parm_stack_space;
#ifdef ARGS_GROW_DOWNWARD
in registers) are allocated. */
#define REG_PARM_STACK_SPACE(DECL) 48
-#define OUTGOING_REG_PARM_STACK_SPACE 1
+#define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 1
/* If an argument can't be passed in registers even though not all argument
registers have been used yet, it is passed on the stack in the space
#ifdef TREE_CODE
-extern int arm_return_in_memory (const_tree);
+extern int arm_return_in_memory (const_tree, const_tree);
#endif
#ifdef RTX_CODE
extern bool arm_vector_mode_supported_p (enum machine_mode);
/* Decide whether a type should be returned in memory (true)
or in a register (false). This is called by the macro
- RETURN_IN_MEMORY. */
+ TARGET_RETURN_IN_MEMORY. */
int
-arm_return_in_memory (const_tree type)
+arm_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
{
HOST_WIDE_INT size;
/* ... Aggregates that are not themselves valid for returning in
a register are not allowed. */
- if (RETURN_IN_MEMORY (TREE_TYPE (field)))
+ if (arm_return_in_memory (TREE_TYPE (field), NULL_TREE))
return 1;
/* Now check the remaining fields, if any. Only bitfields are allowed,
if (FLOAT_TYPE_P (TREE_TYPE (field)))
return 1;
- if (RETURN_IN_MEMORY (TREE_TYPE (field)))
+ if (arm_return_in_memory (TREE_TYPE (field), NULL_TREE))
return 1;
}
/* How large values are returned */
/* A C expression which can inhibit the returning of certain function values
in registers, based on the type of value. */
-#define RETURN_IN_MEMORY(TYPE) arm_return_in_memory (TYPE)
+#define TARGET_RETURN_IN_MEMORY arm_return_in_memory
/* Define DEFAULT_PCC_STRUCT_RETURN to 1 if all structure and union return
values must be in memory. On the ARM, they need only do so if larger
/* Although not normally relevant (since by default, all aggregates
are returned in memory) compiling some parts of libc requires
non-APCS style struct returns. */
-#undef RETURN_IN_MEMORY
+#undef TARGET_RETURN_IN_MEMORY
/* VERY BIG NOTE : Change of structure alignment for RiscBSD.
There are consequences you should be aware of...
extern rtx bfin_gen_compare (rtx, Mmode);
extern int bfin_local_alignment (tree, int);
-extern int bfin_return_in_memory (const_tree);
+extern int bfin_return_in_memory (const_tree, const_tree);
extern void initialize_trampoline (rtx, rtx, rtx);
extern bool bfin_legitimate_address_p (Mmode, rtx, int);
extern rtx bfin_va_arg (tree, tree);
/* Decide whether a type should be returned in memory (true)
or in a register (false). This is called by the macro
- RETURN_IN_MEMORY. */
+ TARGET_RETURN_IN_MEMORY. */
int
-bfin_return_in_memory (const_tree type)
+bfin_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
{
int size = int_size_in_bytes (type);
return size > 2 * UNITS_PER_WORD || size == -1;
/* Define this if the above stack space is to be considered part of the
* space allocated by the caller. */
-#define OUTGOING_REG_PARM_STACK_SPACE 1
+#define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 1
/* Define this if the maximum size of all the outgoing args is to be
accumulated and pushed during the prologue. The amount can be
#define FUNCTION_VALUE_REGNO_P(N) ((N) == REG_R0)
#define DEFAULT_PCC_STRUCT_RETURN 0
-#define RETURN_IN_MEMORY(TYPE) bfin_return_in_memory(TYPE)
+#define TARGET_RETURN_IN_MEMORY bfin_return_in_memory
/* Before the prologue, the return address is in the RETS register. */
#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, REG_RETS)
/* Node: Aggregate Return */
-#if 0
-/* FIXME: Let's try this some time, so we return structures in registers.
- We would cast the result of int_size_in_bytes to unsigned, so we will
- get a huge number for "structures" of variable size (-1). */
-#define RETURN_IN_MEMORY(TYPE) \
- ((unsigned) int_size_in_bytes (TYPE) > CRIS_MAX_ARGS_IN_REGS * UNITS_PER_WORD)
-#endif
-
#define CRIS_STRUCT_VALUE_REGNUM ((CRIS_FIRST_ARG_REG) - 1)
in memory. Since this results in slower code, this should be defined only
if needed for compatibility with other compilers or with an ABI. If you
define this macro to be 0, then the conventions used for structure and union
- return values are decided by the `RETURN_IN_MEMORY' macro.
+ return values are decided by the `TARGET_RETURN_IN_MEMORY' macro.
If not defined, this defaults to the value 1. */
#define DEFAULT_PCC_STRUCT_RETURN 1
#define REG_PARM_STACK_SPACE(FNDECL) (TARGET_64BIT_MS_ABI ? 32 : 0)
#undef OUTGOING_REG_PARM_STACK_SPACE
-#define OUTGOING_REG_PARM_STACK_SPACE (TARGET_64BIT_MS_ABI ? 1 : 0)
+#define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) (TARGET_64BIT_MS_ABI ? 1 : 0)
#undef REGPARM_MAX
#define REGPARM_MAX (TARGET_64BIT_MS_ABI ? 4 : 3)
#define DEFAULT_PCC_STRUCT_RETURN 0
-#undef RETURN_IN_MEMORY
-#define RETURN_IN_MEMORY(TYPE) \
- (TYPE_MODE (TYPE) == BLKmode || \
- (AGGREGATE_TYPE_P (TYPE) && int_size_in_bytes(TYPE) > 8 ))
+#undef TARGET_RETURN_IN_MEMORY
+#define TARGET_RETURN_IN_MEMORY ix86_i386interix_return_in_memory
extern bool ix86_function_value_regno_p (int);
extern bool ix86_function_arg_regno_p (int);
extern int ix86_function_arg_boundary (enum machine_mode, tree);
-extern int ix86_return_in_memory (const_tree);
-extern int ix86_sol10_return_in_memory (const_tree);
-
+extern int ix86_return_in_memory (const_tree, const_tree);
+extern int ix86_sol10_return_in_memory (const_tree,const_tree);
+extern int ix86_i386elf_return_in_memory (const_tree,const_tree);
+extern int ix86_i386interix_return_in_memory (const_tree,const_tree);
extern rtx ix86_force_to_memory (enum machine_mode, rtx);
extern void ix86_free_from_memory (enum machine_mode);
extern void ix86_split_fp_branch (enum rtx_code code, rtx, rtx,
}
int
-ix86_return_in_memory (const_tree type)
+ix86_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
{
const enum machine_mode mode = type_natural_mode (type);
are returned in memory, rather than in MMX registers. */
int
-ix86_sol10_return_in_memory (const_tree type)
+ix86_sol10_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
{
int size;
enum machine_mode mode = type_natural_mode (type);
return size > 12;
}
+int
+ix86_i386elf_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
+{
+ return (TYPE_MODE (type) == BLKmode
+ || (VECTOR_MODE_P (TYPE_MODE (type)) && int_size_in_bytes (type) == 8));
+}
+
+int
+ix86_i386interix_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
+{
+ return (TYPE_MODE (type) == BLKmode
+ || (AGGREGATE_TYPE_P (type) && int_size_in_bytes(type) > 8 ));
+}
+
/* When returning SSE vector types, we have a choice of either
(1) being abi incompatible with a -march switch, or
(2) generating an error.
Choose the STRUCT_VALUE_RTX hook because that's (at present) only
called in response to actually generating a caller or callee that
- uses such a type. As opposed to RETURN_IN_MEMORY, which is called
+ uses such a type. As opposed to TARGET_RETURN_IN_MEMORY, which is called
via aggregate_value_p for general type probing from tree-ssa. */
static rtx
should always be returned in memory. You should instead use
`DEFAULT_PCC_STRUCT_RETURN' to indicate this. */
-#define RETURN_IN_MEMORY(TYPE) \
- ix86_return_in_memory (TYPE)
+#define TARGET_RETURN_IN_MEMORY ix86_return_in_memory
/* This is overridden by <cygwin.h>. */
#define MS_AGGREGATE_RETURN 0
/* The ELF ABI for the i386 says that records and unions are returned
in memory. */
-#undef RETURN_IN_MEMORY
-#define RETURN_IN_MEMORY(TYPE) \
- (TYPE_MODE (TYPE) == BLKmode \
- || (VECTOR_MODE_P (TYPE_MODE (TYPE)) && int_size_in_bytes (TYPE) == 8))
+#undef TARGET_RETURN_IN_MEMORY
+#define TARGET_RETURN_IN_MEMORY ix86_i386elf_return_in_memory
#undef CPP_SPEC
#define CPP_SPEC ""
/* The svr4 ABI for the i386 says that records and unions are returned
in memory. */
-#undef RETURN_IN_MEMORY
-#define RETURN_IN_MEMORY(TYPE) \
- (TYPE_MODE (TYPE) == BLKmode \
- || (VECTOR_MODE_P (TYPE_MODE (TYPE)) && int_size_in_bytes (TYPE) == 8))
+#undef TARGET_RETURN_IN_MEMORY
+#define TARGET_RETURN_IN_MEMORY ix86_i386elf_return_in_memory
#define TARGET_OS_CPP_BUILTINS() \
do \
#undef TARGET_ASM_NAMED_SECTION
#define TARGET_ASM_NAMED_SECTION i386_solaris_elf_named_section
-#undef RETURN_IN_MEMORY
-#define RETURN_IN_MEMORY ix86_sol10_return_in_memory
+#undef TARGET_RETURN_IN_MEMORY
+#define TARGET_RETURN_IN_MEMORY ix86_sol10_return_in_memory
/* The svr4 ABI for the i386 says that records and unions are returned
in memory. */
-#undef RETURN_IN_MEMORY
-#define RETURN_IN_MEMORY(TYPE) \
- (TYPE_MODE (TYPE) == BLKmode \
- || (VECTOR_MODE_P (TYPE_MODE (TYPE)) && int_size_in_bytes (TYPE) == 8))
+#undef TARGET_RETURN_IN_MEMORY
+#define TARGET_RETURN_IN_MEMORY ix86_i386elf_return_in_memory
/* Output at beginning of assembler file. */
/* The .file command should always begin the output. */
/* VxWorks uses the same ABI as Solaris 10. */
-#undef RETURN_IN_MEMORY
-#define RETURN_IN_MEMORY ix86_sol10_return_in_memory
+#undef TARGET_RETURN_IN_MEMORY
+#define TARGET_RETURN_IN_MEMORY ix86_sol10_return_in_memory
#define REG_PARM_STACK_SPACE(FNDECL) 0
-#define OUTGOING_REG_PARM_STACK_SPACE 1
+#define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 1
#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
If `ACCUMULATE_OUTGOING_ARGS' is also defined, the only effect
of this macro is to determine whether the space is included in
`crtl->outgoing_args_size'. */
-#define OUTGOING_REG_PARM_STACK_SPACE 1
+#define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 1
#define STACK_BOUNDARY (TARGET_NEWABI ? 128 : 64)
\f
/* We use d0/d1 for passing parameters, so allocate 8 bytes of space
for a register flushback area. */
#define REG_PARM_STACK_SPACE(DECL) 8
-#define OUTGOING_REG_PARM_STACK_SPACE 1
+#define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 1
#define ACCUMULATE_OUTGOING_ARGS 1
/* So we can allocate space for return pointers once for the function
extern const char * mt_cannot_inline_p (tree);
extern int mt_function_arg_boundary (enum machine_mode, tree);
extern void mt_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, tree, int);
+extern int mt_return_in_memory (const_tree,const_tree);
#endif
#ifdef RTX_CODE
mt_reorg_hazard ();
}
}
+
+int
+mt_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
+{
+ return (int_size_in_bytes (type) > UNITS_PER_WORD);
+}
+
\f
/* Initialize the GCC target structure. */
const struct attribute_spec mt_attribute_table[];
/* Define this if it is the responsibility of the caller to
allocate the area reserved for arguments passed in registers. */
-#define OUTGOING_REG_PARM_STACK_SPACE 1
+#define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 1
/* The number of register assigned to holding function arguments. */
#define MT_NUM_ARG_REGS 4
/* A C expression which can inhibit the returning of certain function
values in registers, based on the type of value. */
-#define RETURN_IN_MEMORY(TYPE) (int_size_in_bytes (TYPE) > UNITS_PER_WORD)
+#define TARGET_RETURN_IN_MEMORY mt_return_in_memory
/* Define this macro to be 1 if all structure and union return values must be
in memory. */
/* Define this if the above stack space is to be considered part of the
space allocated by the caller. */
-#define OUTGOING_REG_PARM_STACK_SPACE 1
+#define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 1
/* Keep the stack pointer constant throughout the function.
This is both an optimization and a necessity: longjmp
/* Define this if the above stack space is to be considered part of the
space allocated by the caller. */
-#define OUTGOING_REG_PARM_STACK_SPACE 1
+#define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 1
/* This is the difference between the logical top of stack and the actual sp.
If `ACCUMULATE_OUTGOING_ARGS' is also defined, the only effect
of this macro is to determine whether the space is included in
`crtl->outgoing_args_size'. */
-#define OUTGOING_REG_PARM_STACK_SPACE 1
+#define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 1
#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0
#define REG_PARM_STACK_SPACE(FNDECL) 0
-#define OUTGOING_REG_PARM_STACK_SPACE 1
+#define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 1
#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) (0)
/* Define this if the above stack space is to be considered part of the
space allocated by the caller. */
-#define OUTGOING_REG_PARM_STACK_SPACE 1
+#define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 1
/* 1 if N is a possible register number for function argument passing. */
#endif
#ifndef OUTGOING_REG_PARM_STACK_SPACE
-#define OUTGOING_REG_PARM_STACK_SPACE 0
+#define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 0
#endif
#endif /* ! GCC_DEFAULTS_H */
@c above is overfull. not sure what to do. --mew 5feb93 did
@c something, not sure if it looks good. --mew 10feb93
-@defmac OUTGOING_REG_PARM_STACK_SPACE
-Define this to a nonzero value if it is the responsibility of the caller
-to allocate the area reserved for arguments passed in registers.
+@defmac OUTGOING_REG_PARM_STACK_SPACE (@var{fntype})
+Define this to a nonzero value if it is the responsibility of the
+caller to allocate the area reserved for arguments passed in registers
+when calling a function of @var{fntype}. @var{fntype} may be NULL
+if the function called is a library function.
If @code{ACCUMULATE_OUTGOING_ARGS} is defined, this macro controls
whether the space for these arguments counts in the value of
static bool
block_move_libcall_safe_for_call_parm (void)
{
+#if defined (REG_PARM_STACK_SPACE)
+ tree fn;
+#endif
+
/* If arguments are pushed on the stack, then they're safe. */
if (PUSH_ARGS)
return true;
/* If registers go on the stack anyway, any argument is sure to clobber
an outgoing argument. */
#if defined (REG_PARM_STACK_SPACE)
- if (OUTGOING_REG_PARM_STACK_SPACE)
- {
- tree fn;
- fn = emit_block_move_libcall_fn (false);
- if (REG_PARM_STACK_SPACE (fn) != 0)
- return false;
- }
+ fn = emit_block_move_libcall_fn (false);
+ if (OUTGOING_REG_PARM_STACK_SPACE ((!fn ? NULL_TREE : TREE_TYPE (fn)))
+ && REG_PARM_STACK_SPACE (fn) != 0)
+ return false;
#endif
/* If any argument goes in memory, then it might clobber an outgoing
#define STACK_DYNAMIC_OFFSET(FNDECL) \
((ACCUMULATE_OUTGOING_ARGS \
? (crtl->outgoing_args_size \
- + (OUTGOING_REG_PARM_STACK_SPACE ? 0 : REG_PARM_STACK_SPACE (FNDECL))) \
+ + (OUTGOING_REG_PARM_STACK_SPACE ((!(FNDECL) ? NULL_TREE : TREE_TYPE (FNDECL))) ? 0 \
+ : REG_PARM_STACK_SPACE (FNDECL))) \
: 0) + (STACK_POINTER_OFFSET))
#else
#define STACK_DYNAMIC_OFFSET(FNDECL) \
if (init_machine_status)
cfun->machine = (*init_machine_status) ();
- if (fndecl != NULL)
+ if (fndecl != NULL_TREE)
{
DECL_STRUCT_FUNCTION (fndecl) = cfun;
cfun->decl = fndecl;
default_return_in_memory (const_tree type,
const_tree fntype ATTRIBUTE_UNUSED)
{
-#ifndef RETURN_IN_MEMORY
return (TYPE_MODE (type) == BLKmode);
-#else
- return RETURN_IN_MEMORY (type);
-#endif
}
rtx