Commit ac294f0b by Kai Tietz Committed by Richard Henderson

defaults.h (OUTGOING_REG_PARM_STACK_SPACE): Provide default.

        * defaults.h (OUTGOING_REG_PARM_STACK_SPACE): Provide default.
        * calls.c (compute_argument_block_size, expand_call,
        emit_library_call_value_1): Don't ifdef OUTGOING_REG_PARM_STACK_SPACE.
        * expr.c (block_move_libcall_safe_for_call_parm): Likewise.
        * function.c (STACK_DYNAMIC_OFFSET): Likewise.
        * doc/tm.texi (OUTGOING_REG_PARM_STACK_SPACE): Update.
        * config/alpha/unicosmk.h, config/bfin/bfin.h, config/iq2000/iq2000.h,
        config/mips/mips.h, config/mn10300/mn10300.h, config/mt/mt.h,
        config/pa/pa.h, config/rs6000/rs6000.h, config/score/score.h,
        config/spu/spu.h, config/v850/v850.h (OUTGOING_REG_PARM_STACK_SPACE):
        Set to 1.

Co-Authored-By: Richard Henderson <rth@redhat.com>

From-SVN: r123135
parent 9a200623
2007-03-22 Kai Tietz <kai.tietz@onevision.com>
Richard Henderson <rth@redhat.com>
* defaults.h (OUTGOING_REG_PARM_STACK_SPACE): Provide default.
* calls.c (compute_argument_block_size, expand_call,
emit_library_call_value_1): Don't ifdef OUTGOING_REG_PARM_STACK_SPACE.
* expr.c (block_move_libcall_safe_for_call_parm): Likewise.
* function.c (STACK_DYNAMIC_OFFSET): Likewise.
* doc/tm.texi (OUTGOING_REG_PARM_STACK_SPACE): Update.
* config/alpha/unicosmk.h, config/bfin/bfin.h, config/iq2000/iq2000.h,
config/mips/mips.h, config/mn10300/mn10300.h, config/mt/mt.h,
config/pa/pa.h, config/rs6000/rs6000.h, config/score/score.h,
config/spu/spu.h, config/v850/v850.h (OUTGOING_REG_PARM_STACK_SPACE):
Set to 1.
2007-03-22 Joseph Myers <joseph@codesourcery.com> 2007-03-22 Joseph Myers <joseph@codesourcery.com>
* c-incpath.c (add_sysroot_to_chain): New. * c-incpath.c (add_sysroot_to_chain): New.
......
...@@ -1222,13 +1222,12 @@ compute_argument_block_size (int reg_parm_stack_space, ...@@ -1222,13 +1222,12 @@ compute_argument_block_size (int reg_parm_stack_space,
= size_binop (MAX_EXPR, args_size->var, = size_binop (MAX_EXPR, args_size->var,
ssize_int (reg_parm_stack_space)); ssize_int (reg_parm_stack_space));
#ifndef OUTGOING_REG_PARM_STACK_SPACE
/* The area corresponding to register parameters is not to count in /* The area corresponding to register parameters is not to count in
the size of the block we need. So make the adjustment. */ the size of the block we need. So make the adjustment. */
args_size->var if (!OUTGOING_REG_PARM_STACK_SPACE)
= size_binop (MINUS_EXPR, args_size->var, args_size->var
ssize_int (reg_parm_stack_space)); = size_binop (MINUS_EXPR, args_size->var,
#endif ssize_int (reg_parm_stack_space));
} }
} }
else else
...@@ -1246,9 +1245,8 @@ compute_argument_block_size (int reg_parm_stack_space, ...@@ -1246,9 +1245,8 @@ compute_argument_block_size (int reg_parm_stack_space,
args_size->constant = MAX (args_size->constant, args_size->constant = MAX (args_size->constant,
reg_parm_stack_space); reg_parm_stack_space);
#ifndef OUTGOING_REG_PARM_STACK_SPACE if (!OUTGOING_REG_PARM_STACK_SPACE)
args_size->constant -= reg_parm_stack_space; args_size->constant -= reg_parm_stack_space;
#endif
} }
return unadjusted_args_size; return unadjusted_args_size;
} }
...@@ -2026,10 +2024,8 @@ expand_call (tree exp, rtx target, int ignore) ...@@ -2026,10 +2024,8 @@ expand_call (tree exp, rtx target, int ignore)
reg_parm_stack_space = REG_PARM_STACK_SPACE (fndecl); reg_parm_stack_space = REG_PARM_STACK_SPACE (fndecl);
#endif #endif
#ifndef OUTGOING_REG_PARM_STACK_SPACE if (!OUTGOING_REG_PARM_STACK_SPACE && reg_parm_stack_space > 0 && PUSH_ARGS)
if (reg_parm_stack_space > 0 && PUSH_ARGS)
must_preallocate = 1; must_preallocate = 1;
#endif
/* Set up a place to return a structure. */ /* Set up a place to return a structure. */
...@@ -2430,12 +2426,11 @@ expand_call (tree exp, rtx target, int ignore) ...@@ -2430,12 +2426,11 @@ expand_call (tree exp, rtx target, int ignore)
Another approach might be to try to reorder the argument Another approach might be to try to reorder the argument
evaluations to avoid this conflicting stack usage. */ evaluations to avoid this conflicting stack usage. */
#ifndef OUTGOING_REG_PARM_STACK_SPACE
/* Since we will be writing into the entire argument area, /* Since we will be writing into the entire argument area,
the map must be allocated for its entire size, not just the map must be allocated for its entire size, not just
the part that is the responsibility of the caller. */ the part that is the responsibility of the caller. */
needed += reg_parm_stack_space; if (!OUTGOING_REG_PARM_STACK_SPACE)
#endif needed += reg_parm_stack_space;
#ifdef ARGS_GROW_DOWNWARD #ifdef ARGS_GROW_DOWNWARD
highest_outgoing_arg_in_use = MAX (initial_highest_arg_in_use, highest_outgoing_arg_in_use = MAX (initial_highest_arg_in_use,
...@@ -2531,12 +2526,10 @@ expand_call (tree exp, rtx target, int ignore) ...@@ -2531,12 +2526,10 @@ expand_call (tree exp, rtx target, int ignore)
an argument. */ an argument. */
if (stack_arg_under_construction) if (stack_arg_under_construction)
{ {
#ifndef OUTGOING_REG_PARM_STACK_SPACE rtx push_size
rtx push_size = GEN_INT (reg_parm_stack_space = GEN_INT (adjusted_args_size.constant
+ adjusted_args_size.constant); + (OUTGOING_REG_PARM_STACK_SPACE ? 0
#else : reg_parm_stack_space));
rtx push_size = GEN_INT (adjusted_args_size.constant);
#endif
if (old_stack_level == 0) if (old_stack_level == 0)
{ {
emit_stack_save (SAVE_BLOCK, &old_stack_level, emit_stack_save (SAVE_BLOCK, &old_stack_level,
...@@ -2706,11 +2699,9 @@ expand_call (tree exp, rtx target, int ignore) ...@@ -2706,11 +2699,9 @@ expand_call (tree exp, rtx target, int ignore)
/* If register arguments require space on the stack and stack space /* If register arguments require space on the stack and stack space
was not preallocated, allocate stack space here for arguments was not preallocated, allocate stack space here for arguments
passed in registers. */ passed in registers. */
#ifdef OUTGOING_REG_PARM_STACK_SPACE if (OUTGOING_REG_PARM_STACK_SPACE && !ACCUMULATE_OUTGOING_ARGS
if (!ACCUMULATE_OUTGOING_ARGS
&& must_preallocate == 0 && reg_parm_stack_space > 0) && must_preallocate == 0 && reg_parm_stack_space > 0)
anti_adjust_stack (GEN_INT (reg_parm_stack_space)); anti_adjust_stack (GEN_INT (reg_parm_stack_space));
#endif
/* Pass the function the address in which to return a /* Pass the function the address in which to return a
structure value. */ structure value. */
...@@ -3532,9 +3523,8 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, ...@@ -3532,9 +3523,8 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
args_size.constant = MAX (args_size.constant, args_size.constant = MAX (args_size.constant,
reg_parm_stack_space); reg_parm_stack_space);
#ifndef OUTGOING_REG_PARM_STACK_SPACE if (!OUTGOING_REG_PARM_STACK_SPACE)
args_size.constant -= reg_parm_stack_space; args_size.constant -= reg_parm_stack_space;
#endif
if (args_size.constant > current_function_outgoing_args_size) if (args_size.constant > current_function_outgoing_args_size)
current_function_outgoing_args_size = args_size.constant; current_function_outgoing_args_size = args_size.constant;
...@@ -3555,12 +3545,11 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, ...@@ -3555,12 +3545,11 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
needed = args_size.constant; needed = args_size.constant;
#ifndef OUTGOING_REG_PARM_STACK_SPACE
/* Since we will be writing into the entire argument area, the /* Since we will be writing into the entire argument area, the
map must be allocated for its entire size, not just the part that map must be allocated for its entire size, not just the part that
is the responsibility of the caller. */ is the responsibility of the caller. */
needed += reg_parm_stack_space; if (!OUTGOING_REG_PARM_STACK_SPACE)
#endif needed += reg_parm_stack_space;
#ifdef ARGS_GROW_DOWNWARD #ifdef ARGS_GROW_DOWNWARD
highest_outgoing_arg_in_use = MAX (initial_highest_arg_in_use, highest_outgoing_arg_in_use = MAX (initial_highest_arg_in_use,
......
...@@ -116,7 +116,7 @@ Boston, MA 02110-1301, USA. */ ...@@ -116,7 +116,7 @@ Boston, MA 02110-1301, USA. */
in registers) are allocated. */ in registers) are allocated. */
#define REG_PARM_STACK_SPACE(DECL) 48 #define REG_PARM_STACK_SPACE(DECL) 48
#define OUTGOING_REG_PARM_STACK_SPACE #define OUTGOING_REG_PARM_STACK_SPACE 1
/* If an argument can't be passed in registers even though not all argument /* 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 registers have been used yet, it is passed on the stack in the space
......
...@@ -180,7 +180,7 @@ extern const char *bfin_library_id_string; ...@@ -180,7 +180,7 @@ extern const char *bfin_library_id_string;
/* Define this if the above stack space is to be considered part of the /* Define this if the above stack space is to be considered part of the
* space allocated by the caller. */ * space allocated by the caller. */
#define OUTGOING_REG_PARM_STACK_SPACE #define OUTGOING_REG_PARM_STACK_SPACE 1
/* Define this if the maximum size of all the outgoing args is to be /* Define this if the maximum size of all the outgoing args is to be
accumulated and pushed during the prologue. The amount can be accumulated and pushed during the prologue. The amount can be
......
...@@ -375,7 +375,7 @@ enum reg_class ...@@ -375,7 +375,7 @@ enum reg_class
#define REG_PARM_STACK_SPACE(FNDECL) 0 #define REG_PARM_STACK_SPACE(FNDECL) 0
#define OUTGOING_REG_PARM_STACK_SPACE #define OUTGOING_REG_PARM_STACK_SPACE 1
#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0 #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
......
...@@ -1807,7 +1807,7 @@ extern const enum reg_class mips_regno_to_class[]; ...@@ -1807,7 +1807,7 @@ extern const enum reg_class mips_regno_to_class[];
If `ACCUMULATE_OUTGOING_ARGS' is also defined, the only effect If `ACCUMULATE_OUTGOING_ARGS' is also defined, the only effect
of this macro is to determine whether the space is included in of this macro is to determine whether the space is included in
`current_function_outgoing_args_size'. */ `current_function_outgoing_args_size'. */
#define OUTGOING_REG_PARM_STACK_SPACE #define OUTGOING_REG_PARM_STACK_SPACE 1
#define STACK_BOUNDARY (TARGET_NEWABI ? 128 : 64) #define STACK_BOUNDARY (TARGET_NEWABI ? 128 : 64)
......
...@@ -529,7 +529,7 @@ enum reg_class { ...@@ -529,7 +529,7 @@ enum reg_class {
/* We use d0/d1 for passing parameters, so allocate 8 bytes of space /* We use d0/d1 for passing parameters, so allocate 8 bytes of space
for a register flushback area. */ for a register flushback area. */
#define REG_PARM_STACK_SPACE(DECL) 8 #define REG_PARM_STACK_SPACE(DECL) 8
#define OUTGOING_REG_PARM_STACK_SPACE #define OUTGOING_REG_PARM_STACK_SPACE 1
#define ACCUMULATE_OUTGOING_ARGS 1 #define ACCUMULATE_OUTGOING_ARGS 1
/* So we can allocate space for return pointers once for the function /* So we can allocate space for return pointers once for the function
......
...@@ -533,7 +533,7 @@ extern struct mt_frame_info current_frame_info; ...@@ -533,7 +533,7 @@ extern struct mt_frame_info current_frame_info;
/* Define this if it is the responsibility of the caller to /* Define this if it is the responsibility of the caller to
allocate the area reserved for arguments passed in registers. */ allocate the area reserved for arguments passed in registers. */
#define OUTGOING_REG_PARM_STACK_SPACE #define OUTGOING_REG_PARM_STACK_SPACE 1
/* The number of register assigned to holding function arguments. */ /* The number of register assigned to holding function arguments. */
#define MT_NUM_ARG_REGS 4 #define MT_NUM_ARG_REGS 4
......
...@@ -602,7 +602,7 @@ extern struct rtx_def *hppa_pic_save_rtx (void); ...@@ -602,7 +602,7 @@ extern struct rtx_def *hppa_pic_save_rtx (void);
/* Define this if the above stack space is to be considered part of the /* Define this if the above stack space is to be considered part of the
space allocated by the caller. */ space allocated by the caller. */
#define OUTGOING_REG_PARM_STACK_SPACE #define OUTGOING_REG_PARM_STACK_SPACE 1
/* Keep the stack pointer constant throughout the function. /* Keep the stack pointer constant throughout the function.
This is both an optimization and a necessity: longjmp This is both an optimization and a necessity: longjmp
......
...@@ -1277,7 +1277,7 @@ extern enum rs6000_abi rs6000_current_abi; /* available for use by subtarget */ ...@@ -1277,7 +1277,7 @@ extern enum rs6000_abi rs6000_current_abi; /* available for use by subtarget */
/* Define this if the above stack space is to be considered part of the /* Define this if the above stack space is to be considered part of the
space allocated by the caller. */ space allocated by the caller. */
#define OUTGOING_REG_PARM_STACK_SPACE #define OUTGOING_REG_PARM_STACK_SPACE 1
/* This is the difference between the logical top of stack and the actual sp. /* This is the difference between the logical top of stack and the actual sp.
......
...@@ -534,7 +534,7 @@ enum reg_class ...@@ -534,7 +534,7 @@ enum reg_class
If `ACCUMULATE_OUTGOING_ARGS' is also defined, the only effect If `ACCUMULATE_OUTGOING_ARGS' is also defined, the only effect
of this macro is to determine whether the space is included in of this macro is to determine whether the space is included in
`current_function_outgoing_args_size'. */ `current_function_outgoing_args_size'. */
#define OUTGOING_REG_PARM_STACK_SPACE #define OUTGOING_REG_PARM_STACK_SPACE 1
#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0 #define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0
......
...@@ -337,7 +337,7 @@ targetm.resolve_overloaded_builtin = spu_resolve_overloaded_builtin; \ ...@@ -337,7 +337,7 @@ targetm.resolve_overloaded_builtin = spu_resolve_overloaded_builtin; \
#define REG_PARM_STACK_SPACE(FNDECL) 0 #define REG_PARM_STACK_SPACE(FNDECL) 0
#define OUTGOING_REG_PARM_STACK_SPACE #define OUTGOING_REG_PARM_STACK_SPACE 1
#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) (0) #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) (0)
......
...@@ -626,7 +626,7 @@ struct cum_arg { int nbytes; int anonymous_args; }; ...@@ -626,7 +626,7 @@ struct cum_arg { int nbytes; int anonymous_args; };
/* Define this if the above stack space is to be considered part of the /* Define this if the above stack space is to be considered part of the
space allocated by the caller. */ space allocated by the caller. */
#define OUTGOING_REG_PARM_STACK_SPACE #define OUTGOING_REG_PARM_STACK_SPACE 1
/* 1 if N is a possible register number for function argument passing. */ /* 1 if N is a possible register number for function argument passing. */
......
...@@ -906,4 +906,8 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA ...@@ -906,4 +906,8 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#define HARD_REGNO_NREGS_WITH_PADDING(REGNO, MODE) -1 #define HARD_REGNO_NREGS_WITH_PADDING(REGNO, MODE) -1
#endif #endif
#ifndef OUTGOING_REG_PARM_STACK_SPACE
#define OUTGOING_REG_PARM_STACK_SPACE 0
#endif
#endif /* ! GCC_DEFAULTS_H */ #endif /* ! GCC_DEFAULTS_H */
...@@ -3730,8 +3730,8 @@ which. ...@@ -3730,8 +3730,8 @@ which.
@c something, not sure if it looks good. --mew 10feb93 @c something, not sure if it looks good. --mew 10feb93
@defmac OUTGOING_REG_PARM_STACK_SPACE @defmac OUTGOING_REG_PARM_STACK_SPACE
Define this if it is the responsibility of the caller to allocate the area Define this to a non-zero value if it is the responsibility of the caller
reserved for arguments passed in registers. to allocate the area reserved for arguments passed in registers.
If @code{ACCUMULATE_OUTGOING_ARGS} is defined, this macro controls If @code{ACCUMULATE_OUTGOING_ARGS} is defined, this macro controls
whether the space for these arguments counts in the value of whether the space for these arguments counts in the value of
......
...@@ -1237,13 +1237,14 @@ block_move_libcall_safe_for_call_parm (void) ...@@ -1237,13 +1237,14 @@ block_move_libcall_safe_for_call_parm (void)
/* If registers go on the stack anyway, any argument is sure to clobber /* If registers go on the stack anyway, any argument is sure to clobber
an outgoing argument. */ an outgoing argument. */
#if defined (REG_PARM_STACK_SPACE) && defined (OUTGOING_REG_PARM_STACK_SPACE) #if defined (REG_PARM_STACK_SPACE)
{ if (OUTGOING_REG_PARM_STACK_SPACE)
tree fn = emit_block_move_libcall_fn (false); {
(void) fn; tree fn;
if (REG_PARM_STACK_SPACE (fn) != 0) fn = emit_block_move_libcall_fn (false);
return false; if (REG_PARM_STACK_SPACE (fn) != 0)
} return false;
}
#endif #endif
/* If any argument goes in memory, then it might clobber an outgoing /* If any argument goes in memory, then it might clobber an outgoing
......
...@@ -1211,12 +1211,12 @@ static int cfa_offset; ...@@ -1211,12 +1211,12 @@ static int cfa_offset;
`current_function_outgoing_args_size'. Nevertheless, we must allow `current_function_outgoing_args_size'. Nevertheless, we must allow
for it when allocating stack dynamic objects. */ for it when allocating stack dynamic objects. */
#if defined(REG_PARM_STACK_SPACE) && ! defined(OUTGOING_REG_PARM_STACK_SPACE) #if defined(REG_PARM_STACK_SPACE)
#define STACK_DYNAMIC_OFFSET(FNDECL) \ #define STACK_DYNAMIC_OFFSET(FNDECL) \
((ACCUMULATE_OUTGOING_ARGS \ ((ACCUMULATE_OUTGOING_ARGS \
? (current_function_outgoing_args_size + REG_PARM_STACK_SPACE (FNDECL)) : 0)\ ? (current_function_outgoing_args_size \
+ (STACK_POINTER_OFFSET)) \ + (OUTGOING_REG_PARM_STACK_SPACE ? 0 : REG_PARM_STACK_SPACE (FNDECL))) \
: 0) + (STACK_POINTER_OFFSET))
#else #else
#define STACK_DYNAMIC_OFFSET(FNDECL) \ #define STACK_DYNAMIC_OFFSET(FNDECL) \
((ACCUMULATE_OUTGOING_ARGS ? current_function_outgoing_args_size : 0) \ ((ACCUMULATE_OUTGOING_ARGS ? current_function_outgoing_args_size : 0) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment