DJ Delorie <d...@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