This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: question about TARGET_MUST_PASS_IN_STACK


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]