From: Trevor Saunders Date: Tue, 28 Apr 2015 04:46:20 +0000 (+0000) Subject: always define ARGS_GROW_DOWNWARD X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=376bddabe1ebdedbc0a99341f5b6a927fd40563f;p=gcc.git always define ARGS_GROW_DOWNWARD gcc/ChangeLog: 2015-04-27 Trevor Saunders * 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. From-SVN: r222507 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6eeba5fde87..4ba2540bba9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,20 @@ +2015-04-27 Trevor Saunders + + * 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 * defaults.h (gen_epilogue): New function. diff --git a/gcc/calls.c b/gcc/calls.c index a6cd33b32a9..b17a9f2141d 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -948,7 +948,7 @@ save_fixed_argument_area (int reg_parm_stack_space, rtx argblock, int *low_to_sa /* 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) @@ -979,7 +979,7 @@ save_fixed_argument_area (int reg_parm_stack_space, rtx argblock, int *low_to_sa BIGGEST_ALIGNMENT / UNITS_PER_WORD) - 1))) save_mode = BLKmode; -#ifdef ARGS_GROW_DOWNWARD +#if ARGS_GROW_DOWNWARD delta = -high; #else delta = low; @@ -1013,7 +1013,7 @@ restore_fixed_argument_area (rtx save_area, rtx argblock, int high_to_save, int int delta; rtx addr, stack_area; -#ifdef ARGS_GROW_DOWNWARD +#if ARGS_GROW_DOWNWARD delta = -high_to_save; #else delta = low_to_save; @@ -1980,7 +1980,7 @@ mem_overlaps_already_clobbered_arg_p (rtx addr, unsigned HOST_WIDE_INT size) i += crtl->args.pretend_args_size; #endif -#ifdef ARGS_GROW_DOWNWARD +#if ARGS_GROW_DOWNWARD i = -i - size; #endif if (size > 0) @@ -2286,7 +2286,7 @@ check_sibcall_argument_overlap (rtx_insn *insn, struct arg_data *arg, 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; @@ -2979,7 +2979,7 @@ expand_call (tree exp, rtx target, int ignore) 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 @@ -3047,7 +3047,7 @@ expand_call (tree exp, rtx target, int ignore) else { argblock = push_block (GEN_INT (needed), 0, 0); -#ifdef ARGS_GROW_DOWNWARD +#if ARGS_GROW_DOWNWARD argblock = plus_constant (Pmode, argblock, needed); #endif } @@ -4122,7 +4122,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, 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 @@ -4213,7 +4213,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, /* 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; @@ -4702,7 +4702,7 @@ store_one_arg (struct arg_data *arg, rtx argblock, int flags, 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) diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h index 6c48883d26d..f9107bcdbce 100644 --- a/gcc/config/pa/pa.h +++ b/gcc/config/pa/pa.h @@ -490,7 +490,7 @@ extern rtx hppa_pic_save_rtx (void); /* #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; diff --git a/gcc/defaults.h b/gcc/defaults.h index 4c8719163e2..47fdcf45e9a 100644 --- a/gcc/defaults.h +++ b/gcc/defaults.h @@ -1225,6 +1225,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #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 diff --git a/gcc/function.c b/gcc/function.c index 14afc53c603..48e6c69265c 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -3771,7 +3771,7 @@ assign_parms (tree fndecl) 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, @@ -4070,7 +4070,7 @@ locate_and_pad_parm (machine_mode passed_mode, tree type, int in_regs, 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), @@ -4175,7 +4175,7 @@ pad_to_arg_alignment (struct args_size *offset_ptr, int boundary, 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); @@ -4191,7 +4191,7 @@ pad_to_arg_alignment (struct args_size *offset_ptr, int boundary, 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); diff --git a/gcc/targhooks.c b/gcc/targhooks.c index 0c141037664..7f694b62242 100644 --- a/gcc/targhooks.c +++ b/gcc/targhooks.c @@ -1786,7 +1786,7 @@ std_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p, 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. */