/* Compute the boundary of the area that needs to be saved, if any. */
high = reg_parm_stack_space;
-#if ARGS_GROW_DOWNWARD
- high += 1;
-#endif
+ if (ARGS_GROW_DOWNWARD)
+ high += 1;
+
if (high > highest_outgoing_arg_in_use)
high = highest_outgoing_arg_in_use;
BIGGEST_ALIGNMENT / UNITS_PER_WORD) - 1)))
save_mode = BLKmode;
-#if ARGS_GROW_DOWNWARD
- delta = -high;
-#else
- delta = low;
-#endif
+ if (ARGS_GROW_DOWNWARD)
+ delta = -high;
+ else
+ delta = low;
+
addr = plus_constant (Pmode, argblock, delta);
stack_area = gen_rtx_MEM (save_mode, memory_address (save_mode, addr));
int delta;
rtx addr, stack_area;
-#if ARGS_GROW_DOWNWARD
- delta = -high_to_save;
-#else
- delta = low_to_save;
-#endif
+ if (ARGS_GROW_DOWNWARD)
+ delta = -high_to_save;
+ else
+ delta = low_to_save;
+
addr = plus_constant (Pmode, argblock, delta);
stack_area = gen_rtx_MEM (save_mode, memory_address (save_mode, addr));
set_mem_align (stack_area, PARM_BOUNDARY);
i += crtl->args.pretend_args_size;
#endif
-#if ARGS_GROW_DOWNWARD
- i = -i - size;
-#endif
+ if (ARGS_GROW_DOWNWARD)
+ i = -i - size;
+
if (size > 0)
{
unsigned HOST_WIDE_INT k;
if (mark_stored_args_map)
{
-#if ARGS_GROW_DOWNWARD
- low = -arg->locate.slot_offset.constant - arg->locate.size.constant;
-#else
- low = arg->locate.slot_offset.constant;
-#endif
+ if (ARGS_GROW_DOWNWARD)
+ low = -arg->locate.slot_offset.constant - arg->locate.size.constant;
+ else
+ low = arg->locate.slot_offset.constant;
for (high = low + arg->locate.size.constant; low < high; low++)
bitmap_set_bit (stored_args_map, low);
if (! OUTGOING_REG_PARM_STACK_SPACE ((!fndecl ? fntype : TREE_TYPE (fndecl))))
needed += reg_parm_stack_space;
-#if ARGS_GROW_DOWNWARD
- highest_outgoing_arg_in_use = MAX (initial_highest_arg_in_use,
- needed + 1);
-#else
- highest_outgoing_arg_in_use = MAX (initial_highest_arg_in_use,
- needed);
-#endif
+ if (ARGS_GROW_DOWNWARD)
+ highest_outgoing_arg_in_use
+ = MAX (initial_highest_arg_in_use, needed + 1);
+ else
+ highest_outgoing_arg_in_use
+ = MAX (initial_highest_arg_in_use, needed);
+
free (stack_usage_map_buf);
stack_usage_map_buf = XNEWVEC (char, highest_outgoing_arg_in_use);
stack_usage_map = stack_usage_map_buf;
else
{
argblock = push_block (GEN_INT (needed), 0, 0);
-#if ARGS_GROW_DOWNWARD
- argblock = plus_constant (Pmode, argblock, needed);
-#endif
+ if (ARGS_GROW_DOWNWARD)
+ argblock = plus_constant (Pmode, argblock, needed);
}
/* We only really need to call `copy_to_reg' in the case
if (! OUTGOING_REG_PARM_STACK_SPACE ((!fndecl ? fntype : TREE_TYPE (fndecl))))
needed += reg_parm_stack_space;
-#if ARGS_GROW_DOWNWARD
- highest_outgoing_arg_in_use = MAX (initial_highest_arg_in_use,
- needed + 1);
-#else
- highest_outgoing_arg_in_use = MAX (initial_highest_arg_in_use,
- needed);
-#endif
+ if (ARGS_GROW_DOWNWARD)
+ highest_outgoing_arg_in_use = MAX (initial_highest_arg_in_use,
+ needed + 1);
+ else
+ highest_outgoing_arg_in_use = MAX (initial_highest_arg_in_use, needed);
+
stack_usage_map_buf = XNEWVEC (char, highest_outgoing_arg_in_use);
stack_usage_map = stack_usage_map_buf;
/* If this is being stored into a pre-allocated, fixed-size,
stack area, save any previous data at that location. */
-#if ARGS_GROW_DOWNWARD
- /* stack_slot is negative, but we want to index stack_usage_map
- with positive values. */
- upper_bound = -argvec[argnum].locate.slot_offset.constant + 1;
- lower_bound = upper_bound - argvec[argnum].locate.size.constant;
-#else
- lower_bound = argvec[argnum].locate.slot_offset.constant;
- upper_bound = lower_bound + argvec[argnum].locate.size.constant;
-#endif
+ if (ARGS_GROW_DOWNWARD)
+ {
+ /* stack_slot is negative, but we want to index stack_usage_map
+ with positive values. */
+ upper_bound = -argvec[argnum].locate.slot_offset.constant + 1;
+ lower_bound = upper_bound - argvec[argnum].locate.size.constant;
+ }
+ else
+ {
+ lower_bound = argvec[argnum].locate.slot_offset.constant;
+ upper_bound = lower_bound + argvec[argnum].locate.size.constant;
+ }
i = lower_bound;
/* Don't worry about things in the fixed argument area;
save any previous data at that location. */
if (argblock && ! variable_size && arg->stack)
{
-#if ARGS_GROW_DOWNWARD
- /* stack_slot is negative, but we want to index stack_usage_map
- with positive values. */
- if (GET_CODE (XEXP (arg->stack_slot, 0)) == PLUS)
- upper_bound = -INTVAL (XEXP (XEXP (arg->stack_slot, 0), 1)) + 1;
- else
- upper_bound = 0;
+ if (ARGS_GROW_DOWNWARD)
+ {
+ /* stack_slot is negative, but we want to index stack_usage_map
+ with positive values. */
+ if (GET_CODE (XEXP (arg->stack_slot, 0)) == PLUS)
+ upper_bound = -INTVAL (XEXP (XEXP (arg->stack_slot, 0), 1)) + 1;
+ else
+ upper_bound = 0;
- lower_bound = upper_bound - arg->locate.size.constant;
-#else
- if (GET_CODE (XEXP (arg->stack_slot, 0)) == PLUS)
- lower_bound = INTVAL (XEXP (XEXP (arg->stack_slot, 0), 1));
+ lower_bound = upper_bound - arg->locate.size.constant;
+ }
else
- lower_bound = 0;
+ {
+ if (GET_CODE (XEXP (arg->stack_slot, 0)) == PLUS)
+ lower_bound = INTVAL (XEXP (XEXP (arg->stack_slot, 0), 1));
+ else
+ lower_bound = 0;
- upper_bound = lower_bound + arg->locate.size.constant;
-#endif
+ upper_bound = lower_bound + arg->locate.size.constant;
+ }
i = lower_bound;
/* Don't worry about things in the fixed argument area;
crtl->args.size = CEIL_ROUND (crtl->args.size,
PARM_BOUNDARY / BITS_PER_UNIT);
-#if ARGS_GROW_DOWNWARD
- crtl->args.arg_offset_rtx
- = (all.stack_args_size.var == 0 ? GEN_INT (-all.stack_args_size.constant)
- : expand_expr (size_diffop (all.stack_args_size.var,
- size_int (-all.stack_args_size.constant)),
- NULL_RTX, VOIDmode, EXPAND_NORMAL));
-#else
- crtl->args.arg_offset_rtx = ARGS_SIZE_RTX (all.stack_args_size);
-#endif
+ if (ARGS_GROW_DOWNWARD)
+ {
+ crtl->args.arg_offset_rtx
+ = (all.stack_args_size.var == 0 ? GEN_INT (-all.stack_args_size.constant)
+ : expand_expr (size_diffop (all.stack_args_size.var,
+ size_int (-all.stack_args_size.constant)),
+ NULL_RTX, VOIDmode, EXPAND_NORMAL));
+ }
+ else
+ crtl->args.arg_offset_rtx = ARGS_SIZE_RTX (all.stack_args_size);
/* See how many bytes, if any, of its args a function should try to pop
on return. */
if (crtl->preferred_stack_boundary < boundary)
crtl->preferred_stack_boundary = boundary;
-#if ARGS_GROW_DOWNWARD
- locate->slot_offset.constant = -initial_offset_ptr->constant;
- if (initial_offset_ptr->var)
- locate->slot_offset.var = size_binop (MINUS_EXPR, ssize_int (0),
- initial_offset_ptr->var);
+ if (ARGS_GROW_DOWNWARD)
+ {
+ locate->slot_offset.constant = -initial_offset_ptr->constant;
+ if (initial_offset_ptr->var)
+ locate->slot_offset.var = size_binop (MINUS_EXPR, ssize_int (0),
+ initial_offset_ptr->var);
- {
- tree s2 = sizetree;
- if (where_pad != none
- && (!tree_fits_uhwi_p (sizetree)
- || (tree_to_uhwi (sizetree) * BITS_PER_UNIT) % round_boundary))
- s2 = round_up (s2, round_boundary / BITS_PER_UNIT);
- SUB_PARM_SIZE (locate->slot_offset, s2);
- }
+ {
+ tree s2 = sizetree;
+ if (where_pad != none
+ && (!tree_fits_uhwi_p (sizetree)
+ || (tree_to_uhwi (sizetree) * BITS_PER_UNIT) % round_boundary))
+ s2 = round_up (s2, round_boundary / BITS_PER_UNIT);
+ SUB_PARM_SIZE (locate->slot_offset, s2);
+ }
+
+ locate->slot_offset.constant += part_size_in_regs;
+
+ if (!in_regs || reg_parm_stack_space > 0)
+ pad_to_arg_alignment (&locate->slot_offset, boundary,
+ &locate->alignment_pad);
+
+ locate->size.constant = (-initial_offset_ptr->constant
+ - locate->slot_offset.constant);
+ if (initial_offset_ptr->var)
+ locate->size.var = size_binop (MINUS_EXPR,
+ size_binop (MINUS_EXPR,
+ ssize_int (0),
+ initial_offset_ptr->var),
+ locate->slot_offset.var);
- locate->slot_offset.constant += part_size_in_regs;
-
- if (!in_regs || reg_parm_stack_space > 0)
- pad_to_arg_alignment (&locate->slot_offset, boundary,
- &locate->alignment_pad);
-
- locate->size.constant = (-initial_offset_ptr->constant
- - locate->slot_offset.constant);
- if (initial_offset_ptr->var)
- locate->size.var = size_binop (MINUS_EXPR,
- size_binop (MINUS_EXPR,
- ssize_int (0),
- initial_offset_ptr->var),
- locate->slot_offset.var);
-
- /* Pad_below needs the pre-rounded size to know how much to pad
- below. */
- locate->offset = locate->slot_offset;
- if (where_pad == downward)
- pad_below (&locate->offset, passed_mode, sizetree);
-
-#else /* !ARGS_GROW_DOWNWARD */
- if (!in_regs || reg_parm_stack_space > 0)
- pad_to_arg_alignment (initial_offset_ptr, boundary,
- &locate->alignment_pad);
- locate->slot_offset = *initial_offset_ptr;
+ /* Pad_below needs the pre-rounded size to know how much to pad
+ below. */
+ locate->offset = locate->slot_offset;
+ if (where_pad == downward)
+ pad_below (&locate->offset, passed_mode, sizetree);
+
+ }
+ else
+ {
+ if (!in_regs || reg_parm_stack_space > 0)
+ pad_to_arg_alignment (initial_offset_ptr, boundary,
+ &locate->alignment_pad);
+ locate->slot_offset = *initial_offset_ptr;
#ifdef PUSH_ROUNDING
- if (passed_mode != BLKmode)
- sizetree = size_int (PUSH_ROUNDING (TREE_INT_CST_LOW (sizetree)));
+ if (passed_mode != BLKmode)
+ sizetree = size_int (PUSH_ROUNDING (TREE_INT_CST_LOW (sizetree)));
#endif
- /* Pad_below needs the pre-rounded size to know how much to pad below
- so this must be done before rounding up. */
- locate->offset = locate->slot_offset;
- if (where_pad == downward)
- pad_below (&locate->offset, passed_mode, sizetree);
+ /* Pad_below needs the pre-rounded size to know how much to pad below
+ so this must be done before rounding up. */
+ locate->offset = locate->slot_offset;
+ if (where_pad == downward)
+ pad_below (&locate->offset, passed_mode, sizetree);
- if (where_pad != none
- && (!tree_fits_uhwi_p (sizetree)
- || (tree_to_uhwi (sizetree) * BITS_PER_UNIT) % round_boundary))
- sizetree = round_up (sizetree, round_boundary / BITS_PER_UNIT);
+ if (where_pad != none
+ && (!tree_fits_uhwi_p (sizetree)
+ || (tree_to_uhwi (sizetree) * BITS_PER_UNIT) % round_boundary))
+ sizetree = round_up (sizetree, round_boundary / BITS_PER_UNIT);
- ADD_PARM_SIZE (locate->size, sizetree);
+ ADD_PARM_SIZE (locate->size, sizetree);
- locate->size.constant -= part_size_in_regs;
-#endif /* ARGS_GROW_DOWNWARD */
+ locate->size.constant -= part_size_in_regs;
+ }
#ifdef FUNCTION_ARG_OFFSET
locate->offset.constant += FUNCTION_ARG_OFFSET (passed_mode, type);
tree offset = size_binop (PLUS_EXPR,
ARGS_SIZE_TREE (*offset_ptr),
sp_offset_tree);
-#if ARGS_GROW_DOWNWARD
- tree rounded = round_down (offset, boundary / BITS_PER_UNIT);
-#else
- tree rounded = round_up (offset, boundary / BITS_PER_UNIT);
-#endif
+ tree rounded;
+ if (ARGS_GROW_DOWNWARD)
+ rounded = round_down (offset, boundary / BITS_PER_UNIT);
+ else
+ rounded = round_up (offset, boundary / BITS_PER_UNIT);
offset_ptr->var = size_binop (MINUS_EXPR, rounded, sp_offset_tree);
/* ARGS_SIZE_TREE includes constant term. */
else
{
offset_ptr->constant = -sp_offset +
-#if ARGS_GROW_DOWNWARD
- FLOOR_ROUND (offset_ptr->constant + sp_offset, boundary_in_bytes);
-#else
+ ARGS_GROW_DOWNWARD ?
+ FLOOR_ROUND (offset_ptr->constant + sp_offset, boundary_in_bytes) :
CEIL_ROUND (offset_ptr->constant + sp_offset, boundary_in_bytes);
-#endif
+
if (boundary > PARM_BOUNDARY)
alignment_pad->constant = offset_ptr->constant - save_constant;
}