diff options
author | tbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-04-28 04:47:09 +0000 |
---|---|---|
committer | tbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-04-28 04:47:09 +0000 |
commit | ccccd62c20fa1f51313ba2c0eeb24f83e0ef9a63 (patch) | |
tree | 281921c3c1d8ed04317c3568e7828cb1d7973513 /gcc/calls.c | |
parent | 25ecdd6d2653288da1f6e74db719f5954f4bde11 (diff) | |
download | gcc-ccccd62c20fa1f51313ba2c0eeb24f83e0ef9a63.tar.gz |
remove #if ARGS_GROW_DOWNWARD
gcc/ChangeLog:
2015-04-27 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* calls.c (save_fixed_argument_area): Don't check
ARGS_GROW_DOWNWARD with the preprocessor.
(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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222508 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/calls.c')
-rw-r--r-- | gcc/calls.c | 125 |
1 files changed, 64 insertions, 61 deletions
diff --git a/gcc/calls.c b/gcc/calls.c index b17a9f2141d..caa7d607059 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -948,9 +948,9 @@ 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; -#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; @@ -979,11 +979,11 @@ save_fixed_argument_area (int reg_parm_stack_space, rtx argblock, int *low_to_sa 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)); @@ -1013,11 +1013,11 @@ restore_fixed_argument_area (rtx save_area, rtx argblock, int high_to_save, int 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); @@ -1980,9 +1980,9 @@ mem_overlaps_already_clobbered_arg_p (rtx addr, unsigned HOST_WIDE_INT size) 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; @@ -2286,11 +2286,10 @@ check_sibcall_argument_overlap (rtx_insn *insn, struct arg_data *arg, 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); @@ -2979,13 +2978,13 @@ expand_call (tree exp, rtx target, int ignore) 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; @@ -3047,9 +3046,8 @@ expand_call (tree exp, rtx target, int ignore) 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 @@ -4122,13 +4120,12 @@ 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; -#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; @@ -4213,15 +4210,18 @@ 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. */ -#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; @@ -4702,23 +4702,26 @@ store_one_arg (struct arg_data *arg, rtx argblock, int flags, 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; |