+2015-04-27 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
+
+ * config/pa/pa.h (ARGS_GROW_DOWNWARD): Define to 1.
+ * defaults.h (ARGS_GROW_DOWNWARD): Define it to 0 by default.
+ * calls.c (save_fixed_argument_area): Don't chekc if
+ ARGS_GROW_DOWNWARD is defined.
+ (restore_fixed_argument_area): Likewise.
+ (mem_overlaps_already_clobbered_arg_p): Likewise.
+ (check_sibcall_argument_overlap): Likewise.
+ (expand_call): Likewise.
+ (emit_library_call_value_1): Likewise.
+ (store_one_arg): Likewise.
+ * function.c (assign_parms): Likewise.
+ (locate_and_pad_parm): Likewise.
+ (pad_to_arg_alignment): Likewise.
+ * targhooks.c (std_gimplify_va_arg_expr): Likewise.
+
2015-04-27 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* defaults.h (gen_epilogue): New function.
/* Compute the boundary of the area that needs to be saved, if any. */
high = reg_parm_stack_space;
-#ifdef ARGS_GROW_DOWNWARD
+#if ARGS_GROW_DOWNWARD
high += 1;
#endif
if (high > highest_outgoing_arg_in_use)
BIGGEST_ALIGNMENT / UNITS_PER_WORD) - 1)))
save_mode = BLKmode;
-#ifdef ARGS_GROW_DOWNWARD
+#if ARGS_GROW_DOWNWARD
delta = -high;
#else
delta = low;
int delta;
rtx addr, stack_area;
-#ifdef ARGS_GROW_DOWNWARD
+#if ARGS_GROW_DOWNWARD
delta = -high_to_save;
#else
delta = low_to_save;
i += crtl->args.pretend_args_size;
#endif
-#ifdef ARGS_GROW_DOWNWARD
+#if ARGS_GROW_DOWNWARD
i = -i - size;
#endif
if (size > 0)
if (mark_stored_args_map)
{
-#ifdef ARGS_GROW_DOWNWARD
+#if ARGS_GROW_DOWNWARD
low = -arg->locate.slot_offset.constant - arg->locate.size.constant;
#else
low = arg->locate.slot_offset.constant;
if (! OUTGOING_REG_PARM_STACK_SPACE ((!fndecl ? fntype : TREE_TYPE (fndecl))))
needed += reg_parm_stack_space;
-#ifdef ARGS_GROW_DOWNWARD
+#if ARGS_GROW_DOWNWARD
highest_outgoing_arg_in_use = MAX (initial_highest_arg_in_use,
needed + 1);
#else
else
{
argblock = push_block (GEN_INT (needed), 0, 0);
-#ifdef ARGS_GROW_DOWNWARD
+#if ARGS_GROW_DOWNWARD
argblock = plus_constant (Pmode, argblock, needed);
#endif
}
if (! OUTGOING_REG_PARM_STACK_SPACE ((!fndecl ? fntype : TREE_TYPE (fndecl))))
needed += reg_parm_stack_space;
-#ifdef ARGS_GROW_DOWNWARD
+#if ARGS_GROW_DOWNWARD
highest_outgoing_arg_in_use = MAX (initial_highest_arg_in_use,
needed + 1);
#else
/* If this is being stored into a pre-allocated, fixed-size,
stack area, save any previous data at that location. */
-#ifdef ARGS_GROW_DOWNWARD
+#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;
save any previous data at that location. */
if (argblock && ! variable_size && arg->stack)
{
-#ifdef ARGS_GROW_DOWNWARD
+#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)
/* #define STACK_GROWS_DOWNWARD */
/* Believe it or not. */
-#define ARGS_GROW_DOWNWARD
+#define ARGS_GROW_DOWNWARD 1
/* Define this to nonzero if the nominal address of the stack frame
is at the high-address end of the local variables;
#define EPILOGUE_USES(REG) false
#endif
+#ifndef ARGS_GROW_DOWNWARD
+#define ARGS_GROW_DOWNWARD 0
+#endif
+
#ifdef GCC_INSN_FLAGS_H
/* Dependent default target macro definitions
crtl->args.size = CEIL_ROUND (crtl->args.size,
PARM_BOUNDARY / BITS_PER_UNIT);
-#ifdef ARGS_GROW_DOWNWARD
+#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,
if (crtl->preferred_stack_boundary < boundary)
crtl->preferred_stack_boundary = boundary;
-#ifdef ARGS_GROW_DOWNWARD
+#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),
tree offset = size_binop (PLUS_EXPR,
ARGS_SIZE_TREE (*offset_ptr),
sp_offset_tree);
-#ifdef ARGS_GROW_DOWNWARD
+#if ARGS_GROW_DOWNWARD
tree rounded = round_down (offset, boundary / BITS_PER_UNIT);
#else
tree rounded = round_up (offset, boundary / BITS_PER_UNIT);
else
{
offset_ptr->constant = -sp_offset +
-#ifdef ARGS_GROW_DOWNWARD
+#if ARGS_GROW_DOWNWARD
FLOOR_ROUND (offset_ptr->constant + sp_offset, boundary_in_bytes);
#else
CEIL_ROUND (offset_ptr->constant + sp_offset, boundary_in_bytes);
unsigned HOST_WIDE_INT align, boundary;
bool indirect;
-#ifdef ARGS_GROW_DOWNWARD
+#if ARGS_GROW_DOWNWARD
/* All of the alignment and movement below is for args-grow-up machines.
As of 2004, there are only 3 ARGS_GROW_DOWNWARD targets, and they all
implement their own specialized gimplify_va_arg_expr routines. */