diff options
author | Alan Modra <amodra@bigpond.net.au> | 2003-02-23 22:19:39 +0000 |
---|---|---|
committer | Alan Modra <amodra@gcc.gnu.org> | 2003-02-24 08:49:39 +1030 |
commit | 8403445abac6b5d1b03903c3f23fd9a28c550438 (patch) | |
tree | 3072cb4fe732b3df37e851d737c014b16029b598 /gcc/calls.c | |
parent | ef9063812820167f826b3f7fce2827826599d80c (diff) | |
download | gcc-8403445abac6b5d1b03903c3f23fd9a28c550438.zip gcc-8403445abac6b5d1b03903c3f23fd9a28c550438.tar.gz gcc-8403445abac6b5d1b03903c3f23fd9a28c550438.tar.bz2 |
calls.c (store_one_arg): Revert 1999-02-16 change.
* calls.c (store_one_arg): Revert 1999-02-16 change. Revert
2000-12-17 change. Pass EXPAND_STACK_PARM to expand_expr.
* expr.h (enum expand_modifier): Define EXPAND_STACK_PARM.
(enum block_op_methods): Reorder for better store_expr optimization.
* expr.c (store_expr): Test bit 1 of "want_value" for call param
stores, test bit 0 for original want_value meaning. Pass
BLOCK_OP_CALL_PARM to emit_block_move when bit 1 set. Adjust
recursive calls, and calls to expand_param.
(expand_expr): Handle EXPAND_STACK_PARM modifier. When cse
expected, set target to 0 rather than to subtarget. Formatting.
From-SVN: r63337
Diffstat (limited to 'gcc/calls.c')
-rw-r--r-- | gcc/calls.c | 46 |
1 files changed, 7 insertions, 39 deletions
diff --git a/gcc/calls.c b/gcc/calls.c index 4102c01..abd88fe 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -4341,13 +4341,6 @@ store_one_arg (arg, argblock, flags, variable_size, reg_parm_stack_space) } } } - /* Now that we have saved any slots that will be overwritten by this - store, mark all slots this store will use. We must do this before - we actually expand the argument since the expansion itself may - trigger library calls which might need to use the same stack slot. */ - if (argblock && ! variable_size && arg->stack) - for (i = lower_bound; i < upper_bound; i++) - stack_usage_map[i] = 1; } /* If this isn't going to be placed on both the stack and in registers, @@ -4400,7 +4393,7 @@ store_one_arg (arg, argblock, flags, variable_size, reg_parm_stack_space) (partial || TYPE_MODE (TREE_TYPE (pval)) != arg->mode) ? NULL_RTX : arg->stack, - VOIDmode, 0); + VOIDmode, EXPAND_STACK_PARM); /* If we are promoting object (or for any other reason) the mode doesn't agree, convert the mode. */ @@ -4543,37 +4536,6 @@ store_one_arg (arg, argblock, flags, variable_size, reg_parm_stack_space) } } - /* Special handling is required if part of the parameter lies in the - register parameter area. The argument may be copied into the stack - slot using memcpy(), but the original contents of the register - parameter area will be restored after the memcpy() call. - - To ensure that the part that lies in the register parameter area - is copied correctly, we emit a separate push for that part. This - push should be small enough to avoid a call to memcpy(). */ -#ifndef STACK_PARMS_IN_REG_PARM_AREA - if (arg->reg && arg->pass_on_stack) -#else - if (1) -#endif - { - if (arg->offset.constant < reg_parm_stack_space && arg->offset.var) - error ("variable offset is passed partially in stack and in reg"); - else if (arg->offset.constant < reg_parm_stack_space && arg->size.var) - error ("variable size is passed partially in stack and in reg"); - else if (arg->offset.constant < reg_parm_stack_space - && ((arg->offset.constant + arg->size.constant) - > reg_parm_stack_space)) - { - rtx size_rtx1 = GEN_INT (reg_parm_stack_space - arg->offset.constant); - emit_push_insn (arg->value, arg->mode, TREE_TYPE (pval), size_rtx1, - parm_align, partial, reg, excess, argblock, - ARGS_SIZE_RTX (arg->offset), reg_parm_stack_space, - ARGS_SIZE_RTX (arg->alignment_pad)); - } - } - - emit_push_insn (arg->value, arg->mode, TREE_TYPE (pval), size_rtx, parm_align, partial, reg, excess, argblock, ARGS_SIZE_RTX (arg->offset), reg_parm_stack_space, @@ -4591,6 +4553,12 @@ store_one_arg (arg, argblock, flags, variable_size, reg_parm_stack_space) arg->value = arg->stack_slot; } + /* Mark all slots this store used. */ + if (ACCUMULATE_OUTGOING_ARGS && !(flags & ECF_SIBCALL) + && argblock && ! variable_size && arg->stack) + for (i = lower_bound; i < upper_bound; i++) + stack_usage_map[i] = 1; + /* Once we have pushed something, pops can't safely be deferred during the rest of the arguments. */ NO_DEFER_POP; |