Commit 2e4ceca5 by Ulrich Weigand Committed by Ulrich Weigand

function.c (assign_parms): Use all.reg_parm_stack_space instead of re-evaluating…

function.c (assign_parms): Use all.reg_parm_stack_space instead of re-evaluating REG_PARM_STACK_SPACE...

2013-11-14  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
	    Alan Modra  <amodra@gmail.com>

	* function.c (assign_parms): Use all.reg_parm_stack_space instead
	of re-evaluating REG_PARM_STACK_SPACE target macro.
	(locate_and_pad_parm): New parameter REG_PARM_STACK_SPACE.  Use it
	instead of evaluating target macro REG_PARM_STACK_SPACE every time.
	(assign_parm_find_entry_rtl): Update call.
	* calls.c (initialize_argument_information): Update call.
	(emit_library_call_value_1): Likewise.
	* expr.h (locate_and_pad_parm): Update prototype.

Co-Authored-By: Alan Modra <amodra@gmail.com>

From-SVN: r204798
parent a7973050
2013-11-14 Ulrich Weigand <Ulrich.Weigand@de.ibm.com> 2013-11-14 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
Alan Modra <amodra@gmail.com>
* function.c (assign_parms): Use all.reg_parm_stack_space instead
of re-evaluating REG_PARM_STACK_SPACE target macro.
(locate_and_pad_parm): New parameter REG_PARM_STACK_SPACE. Use it
instead of evaluating target macro REG_PARM_STACK_SPACE every time.
(assign_parm_find_entry_rtl): Update call.
* calls.c (initialize_argument_information): Update call.
(emit_library_call_value_1): Likewise.
* expr.h (locate_and_pad_parm): Update prototype.
2013-11-14 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* calls.c (store_unaligned_arguments_into_pseudos): Skip PARALLEL * calls.c (store_unaligned_arguments_into_pseudos): Skip PARALLEL
arguments. arguments.
...@@ -1326,6 +1326,7 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, ...@@ -1326,6 +1326,7 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED,
#else #else
args[i].reg != 0, args[i].reg != 0,
#endif #endif
reg_parm_stack_space,
args[i].pass_on_stack ? 0 : args[i].partial, args[i].pass_on_stack ? 0 : args[i].partial,
fndecl, args_size, &args[i].locate); fndecl, args_size, &args[i].locate);
#ifdef BLOCK_REG_PADDING #ifdef BLOCK_REG_PADDING
...@@ -3736,7 +3737,8 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, ...@@ -3736,7 +3737,8 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
#else #else
argvec[count].reg != 0, argvec[count].reg != 0,
#endif #endif
0, NULL_TREE, &args_size, &argvec[count].locate); reg_parm_stack_space, 0,
NULL_TREE, &args_size, &argvec[count].locate);
if (argvec[count].reg == 0 || argvec[count].partial != 0 if (argvec[count].reg == 0 || argvec[count].partial != 0
|| reg_parm_stack_space > 0) || reg_parm_stack_space > 0)
...@@ -3823,7 +3825,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, ...@@ -3823,7 +3825,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
#else #else
argvec[count].reg != 0, argvec[count].reg != 0,
#endif #endif
argvec[count].partial, reg_parm_stack_space, argvec[count].partial,
NULL_TREE, &args_size, &argvec[count].locate); NULL_TREE, &args_size, &argvec[count].locate);
args_size.constant += argvec[count].locate.size.constant; args_size.constant += argvec[count].locate.size.constant;
gcc_assert (!argvec[count].locate.size.var); gcc_assert (!argvec[count].locate.size.var);
......
...@@ -521,8 +521,8 @@ extern rtx expand_divmod (int, enum tree_code, enum machine_mode, rtx, rtx, ...@@ -521,8 +521,8 @@ extern rtx expand_divmod (int, enum tree_code, enum machine_mode, rtx, rtx,
rtx, int); rtx, int);
#endif #endif
extern void locate_and_pad_parm (enum machine_mode, tree, int, int, tree, extern void locate_and_pad_parm (enum machine_mode, tree, int, int, int,
struct args_size *, tree, struct args_size *,
struct locate_and_pad_arg_data *); struct locate_and_pad_arg_data *);
/* Return the CODE_LABEL rtx for a LABEL_DECL, creating it if necessary. */ /* Return the CODE_LABEL rtx for a LABEL_DECL, creating it if necessary. */
......
...@@ -2515,6 +2515,7 @@ assign_parm_find_entry_rtl (struct assign_parm_data_all *all, ...@@ -2515,6 +2515,7 @@ assign_parm_find_entry_rtl (struct assign_parm_data_all *all,
} }
locate_and_pad_parm (data->promoted_mode, data->passed_type, in_regs, locate_and_pad_parm (data->promoted_mode, data->passed_type, in_regs,
all->reg_parm_stack_space,
entry_parm ? data->partial : 0, current_function_decl, entry_parm ? data->partial : 0, current_function_decl,
&all->stack_args_size, &data->locate); &all->stack_args_size, &data->locate);
...@@ -3503,11 +3504,7 @@ assign_parms (tree fndecl) ...@@ -3503,11 +3504,7 @@ assign_parms (tree fndecl)
/* Adjust function incoming argument size for alignment and /* Adjust function incoming argument size for alignment and
minimum length. */ minimum length. */
#ifdef REG_PARM_STACK_SPACE crtl->args.size = MAX (crtl->args.size, all.reg_parm_stack_space);
crtl->args.size = MAX (crtl->args.size,
REG_PARM_STACK_SPACE (fndecl));
#endif
crtl->args.size = CEIL_ROUND (crtl->args.size, crtl->args.size = CEIL_ROUND (crtl->args.size,
PARM_BOUNDARY / BITS_PER_UNIT); PARM_BOUNDARY / BITS_PER_UNIT);
...@@ -3711,6 +3708,9 @@ gimplify_parameters (void) ...@@ -3711,6 +3708,9 @@ gimplify_parameters (void)
IN_REGS is nonzero if the argument will be passed in registers. It will IN_REGS is nonzero if the argument will be passed in registers. It will
never be set if REG_PARM_STACK_SPACE is not defined. never be set if REG_PARM_STACK_SPACE is not defined.
REG_PARM_STACK_SPACE is the number of bytes of stack space reserved
for arguments which are passed in registers.
FNDECL is the function in which the argument was defined. FNDECL is the function in which the argument was defined.
There are two types of rounding that are done. The first, controlled by There are two types of rounding that are done. The first, controlled by
...@@ -3731,19 +3731,16 @@ gimplify_parameters (void) ...@@ -3731,19 +3731,16 @@ gimplify_parameters (void)
void void
locate_and_pad_parm (enum machine_mode passed_mode, tree type, int in_regs, locate_and_pad_parm (enum machine_mode passed_mode, tree type, int in_regs,
int partial, tree fndecl ATTRIBUTE_UNUSED, int reg_parm_stack_space, int partial,
tree fndecl ATTRIBUTE_UNUSED,
struct args_size *initial_offset_ptr, struct args_size *initial_offset_ptr,
struct locate_and_pad_arg_data *locate) struct locate_and_pad_arg_data *locate)
{ {
tree sizetree; tree sizetree;
enum direction where_pad; enum direction where_pad;
unsigned int boundary, round_boundary; unsigned int boundary, round_boundary;
int reg_parm_stack_space = 0;
int part_size_in_regs; int part_size_in_regs;
#ifdef REG_PARM_STACK_SPACE
reg_parm_stack_space = REG_PARM_STACK_SPACE (fndecl);
/* If we have found a stack parm before we reach the end of the /* If we have found a stack parm before we reach the end of the
area reserved for registers, skip that area. */ area reserved for registers, skip that area. */
if (! in_regs) if (! in_regs)
...@@ -3761,7 +3758,6 @@ locate_and_pad_parm (enum machine_mode passed_mode, tree type, int in_regs, ...@@ -3761,7 +3758,6 @@ locate_and_pad_parm (enum machine_mode passed_mode, tree type, int in_regs,
initial_offset_ptr->constant = reg_parm_stack_space; initial_offset_ptr->constant = reg_parm_stack_space;
} }
} }
#endif /* REG_PARM_STACK_SPACE */
part_size_in_regs = (reg_parm_stack_space == 0 ? partial : 0); part_size_in_regs = (reg_parm_stack_space == 0 ? partial : 0);
...@@ -3824,11 +3820,7 @@ locate_and_pad_parm (enum machine_mode passed_mode, tree type, int in_regs, ...@@ -3824,11 +3820,7 @@ locate_and_pad_parm (enum machine_mode passed_mode, tree type, int in_regs,
locate->slot_offset.constant += part_size_in_regs; locate->slot_offset.constant += part_size_in_regs;
if (!in_regs if (!in_regs || reg_parm_stack_space > 0)
#ifdef REG_PARM_STACK_SPACE
|| REG_PARM_STACK_SPACE (fndecl) > 0
#endif
)
pad_to_arg_alignment (&locate->slot_offset, boundary, pad_to_arg_alignment (&locate->slot_offset, boundary,
&locate->alignment_pad); &locate->alignment_pad);
...@@ -3848,11 +3840,7 @@ locate_and_pad_parm (enum machine_mode passed_mode, tree type, int in_regs, ...@@ -3848,11 +3840,7 @@ locate_and_pad_parm (enum machine_mode passed_mode, tree type, int in_regs,
pad_below (&locate->offset, passed_mode, sizetree); pad_below (&locate->offset, passed_mode, sizetree);
#else /* !ARGS_GROW_DOWNWARD */ #else /* !ARGS_GROW_DOWNWARD */
if (!in_regs if (!in_regs || reg_parm_stack_space > 0)
#ifdef REG_PARM_STACK_SPACE
|| REG_PARM_STACK_SPACE (fndecl) > 0
#endif
)
pad_to_arg_alignment (initial_offset_ptr, boundary, pad_to_arg_alignment (initial_offset_ptr, boundary,
&locate->alignment_pad); &locate->alignment_pad);
locate->slot_offset = *initial_offset_ptr; locate->slot_offset = *initial_offset_ptr;
......
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