2002-08-18 H.J. Lu * calls.c (store_one_arg): Remove ATTRIBUTE_UNUSED on variable_size. Mark any slots used for the argument as in-use only before calling expand_expr to expand the argument. --- gcc/calls.c.copy Sun Aug 18 07:35:11 2002 +++ gcc/calls.c Sun Aug 18 07:47:36 2002 @@ -4270,7 +4270,7 @@ store_one_arg (arg, argblock, flags, var struct arg_data *arg; rtx argblock; int flags; - int variable_size ATTRIBUTE_UNUSED; + int variable_size; int reg_parm_stack_space; { tree pval = arg->tree_value; @@ -4346,13 +4346,6 @@ store_one_arg (arg, argblock, flags, var } } } - /* 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,6 +4393,21 @@ store_one_arg (arg, argblock, flags, var if (arg->pass_on_stack) stack_arg_under_construction++; + + /* 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 (ACCUMULATE_OUTGOING_ARGS && !(flags & ECF_SIBCALL) + && argblock && ! variable_size && arg->stack) + { + for (i = lower_bound; i < upper_bound; i++) + stack_usage_map[i] = 1; + + /* Set it so that we don't do it again. */ + variable_size = 1; + } arg->value = expand_expr (pval, (partial @@ -4579,6 +4587,11 @@ store_one_arg (arg, argblock, flags, var arg->value = arg->stack_slot; } + 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;