"Paulo J. Matos" <pa...@matos-sorge.com> writes:

> I am finding slightly confusing the difference between
> outgoing_args_size and pretend_args_size.
>
> I think I understand pretend_args_size, at least on the specific case
> of my port. The first two words of arguments go into two register the
> remaining goes into the stack. However, if the first argument is one
> word of size and the second two words of size, the second argument is
> split between register and stack and pretend_args_size is 1.
>
> However, I am slightly unsure about outgoing_args_size. It mentions
> outgoing_args but I don't really know if it is what I think it is.
>
> If I write:
> void foo(int *x);
>
> is x considered an outgoing arg?
>
> Can someone try to explain the difference between these?

outgoing_args_size is the number of bytes required by called functions.
In your question above, the answer is no; x is an incoming argument.  If
you write

extern foo(int);
void bar(void) { foo (1); }

then the outgoing_args_size of bar is sizeof(int), because that is the
maximum size of the the arguments passed in a function call.

As you can see outgoing_args_size has nothing to do with
pretend_args_size.

outgoing_args_size matters mainly if ACCUMULATE_OUTGOING_ARGS is
nonzero.

Ian

Reply via email to