This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Use of VLA in struct in gcc-torture/execute/20020412-1.c
- From: David Edelsohn <dje at watson dot ibm dot com>
- To: Richard Henderson <rth at redhat dot com>, John David Anglin <dave at hiauly1 dot hia dot nrc dot ca>, gcc at gcc dot gnu dot org
- Date: Sun, 08 Sep 2002 01:01:33 -0400
- Subject: Re: Use of VLA in struct in gcc-torture/execute/20020412-1.c
>>>>> Richard Henderson writes:
Richard> Actually, no. Think about how subsequent arguments must be
Richard> handled.
On further consideration, I think that the general case is fairly
easy as well, based on your statement that GCC can handle the variable
arguments in the stack case.
For AIX, PPC64 Linux, and hppa-linux, the registers reflect
exactly what would be in the stack. Therefore, construct the *entire*
argument list *only* in the stack and then emit loads of all of the
parameter registers -- the inverse of the callee taking the address of the
arguments which forces storing all of the arguments to stack slots.
For the example of the variable size being a constant in the
function, GCC should be able to reduce that to a normal, fixed-size
parameter list call, but that's an optimization.
David