This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: question about TARGET_MUST_PASS_IN_STACK
- From: Ian Lance Taylor <iant at google dot com>
- To: DJ Delorie <dj at redhat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 03 Jun 2009 00:04:00 -0700
- Subject: Re: question about TARGET_MUST_PASS_IN_STACK
- References: <200906030335.n533ZZJ6031276@greed.delorie.com>
DJ Delorie <dj@redhat.com> writes:
> On xstormy16, when structures with variable-length arrays are passed
> to functions (execute/20020412-1.c), it appears that they're passed by
> reference (based on examining the stack), despite the port not
> explicitly requesting that.
>
> This causes a mis-match in the va_arg code, which assumes the array is
> passed by value, just pushed to the stack portion of the argument
> list.
>
> Which interpretation of these macros is correct? (based on that, I'll
> debug further)
>
> Xstormy16 uses the default TARGET_MUST_PASS_IN_STACK, which returns
> true only for variable-length arrays, and uses the default
> TARGET_PASS_BY_REFERENCE, which always returns false.
See the function pass_by_reference in function.c.
/* GCC post 3.4 passes *all* variable sized types by reference. */
Ian