rtx old_stack_level = 0;
int old_pending_adj = 0;
int old_inhibit_defer_pop = inhibit_defer_pop;
+ int old_arg_space_so_far = arg_space_so_far;
rtx call_fusage = 0;
register tree p;
register int i;
/* If we pushed args in forward order, perform stack alignment
after pushing the last arg. */
if (argblock == 0)
- anti_adjust_stack (GEN_INT (args_size.constant - unadjusted_args_size));
+ {
+ anti_adjust_stack (GEN_INT (args_size.constant - unadjusted_args_size));
+ arg_space_so_far += args_size.constant - unadjusted_args_size;
+ }
#endif
#endif
FUNCTION_ARG (args_so_far, VOIDmode, void_type_node, 1),
valreg, old_inhibit_defer_pop, call_fusage, is_const, nothrow);
+ /* Stack pointer ought to be restored to the value before call. */
+ if (old_arg_space_so_far != arg_space_so_far)
+ abort();
+
/* If call is cse'able, make appropriate pair of reg-notes around it.
Test valreg so we don't crash; may safely ignore `const'
if return type is void. Disable for PARALLEL return values, because
struct args_size offset; struct args_size size; rtx save_area; };
struct arg *argvec;
int old_inhibit_defer_pop = inhibit_defer_pop;
+ int old_arg_space_so_far = arg_space_so_far;
rtx call_fusage = 0;
int reg_parm_stack_space = 0;
int nothrow;
original_args_size = args_size;
#ifdef PREFERRED_STACK_BOUNDARY
- args_size.constant = (((args_size.constant + (STACK_BYTES - 1))
- / STACK_BYTES) * STACK_BYTES);
+ args_size.constant = (((args_size.constant
+ + arg_space_so_far
+ + pending_stack_adjust
+ + STACK_BYTES - 1)
+ / STACK_BYTES
+ * STACK_BYTES)
+ - arg_space_so_far
+ - pending_stack_adjust);
#endif
args_size.constant = MAX (args_size.constant,
/* If we push args individually in reverse order, perform stack alignment
before the first push (the last arg). */
if (argblock == 0)
- anti_adjust_stack (GEN_INT (args_size.constant
- - original_args_size.constant));
+ {
+ anti_adjust_stack (GEN_INT (args_size.constant
+ - original_args_size.constant));
+ arg_space_so_far += args_size.constant - original_args_size.constant;
+ }
#endif
#endif
emit_push_insn (val, mode, NULL_TREE, NULL_RTX, 0, partial, reg, 0,
argblock, GEN_INT (argvec[argnum].offset.constant),
reg_parm_stack_space, ARGS_SIZE_RTX (alignment_pad));
+ arg_space_so_far += argvec[argnum].size.constant;
#ifdef ACCUMULATE_OUTGOING_ARGS
/* Now mark the segment we just used. */
/* If we pushed args in forward order, perform stack alignment
after pushing the last arg. */
if (argblock == 0)
- anti_adjust_stack (GEN_INT (args_size.constant
- - original_args_size.constant));
+ {
+ anti_adjust_stack (GEN_INT (args_size.constant
+ - original_args_size.constant));
+ arg_space_so_far += args_size.constant - original_args_size.constant;
+ }
#endif
#endif
pop_temp_slots ();
+ /* Stack pointer ought to be restored to the value before call. */
+ if (old_arg_space_so_far != arg_space_so_far)
+ abort();
+
/* Now restore inhibit_defer_pop to its actual original value. */
OK_DEFER_POP;
struct args_size offset; struct args_size size; rtx save_area; };
struct arg *argvec;
int old_inhibit_defer_pop = inhibit_defer_pop;
+ int old_arg_space_so_far = arg_space_so_far;
rtx call_fusage = 0;
rtx mem_value = 0;
int pcc_struct_value = 0;
original_args_size = args_size;
#ifdef PREFERRED_STACK_BOUNDARY
- args_size.constant = (((args_size.constant + (STACK_BYTES - 1))
- / STACK_BYTES) * STACK_BYTES);
+ args_size.constant = (((args_size.constant
+ + arg_space_so_far
+ + pending_stack_adjust
+ + STACK_BYTES - 1)
+ / STACK_BYTES
+ * STACK_BYTES)
+ - arg_space_so_far
+ - pending_stack_adjust);
#endif
args_size.constant = MAX (args_size.constant,
/* If we push args individually in reverse order, perform stack alignment
before the first push (the last arg). */
if (argblock == 0)
- anti_adjust_stack (GEN_INT (args_size.constant
- - original_args_size.constant));
+ {
+ anti_adjust_stack (GEN_INT (args_size.constant
+ - original_args_size.constant));
+ arg_space_so_far += args_size.constant - original_args_size.constant;
+ }
#endif
#endif
emit_push_insn (val, mode, NULL_TREE, NULL_RTX, 0, partial, reg, 0,
argblock, GEN_INT (argvec[argnum].offset.constant),
reg_parm_stack_space, ARGS_SIZE_RTX (alignment_pad));
+ arg_space_so_far += argvec[argnum].size.constant;
#ifdef ACCUMULATE_OUTGOING_ARGS
/* Now mark the segment we just used. */
/* If we pushed args in forward order, perform stack alignment
after pushing the last arg. */
if (argblock == 0)
- anti_adjust_stack (GEN_INT (args_size.constant
- - original_args_size.constant));
+ {
+ anti_adjust_stack (GEN_INT (args_size.constant
+ - original_args_size.constant));
+ arg_space_so_far += args_size.constant - unadjusted_args_size;
+ }
#endif
#endif
pop_temp_slots ();
+ /* Stack pointer ought to be restored to the value before call. */
+ if (old_arg_space_so_far != arg_space_so_far)
+ abort();
+
/* Copy the value to the right place. */
if (outmode != VOIDmode)
{