This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: ARM: testsuite gcc.c-torture/execute/20020307-2.c failure
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: jeroen dobbelaere <jeroen dot dobbelaere at acunia dot com>
- Cc: gcc at gcc dot gnu dot org, Richard dot Earnshaw at arm dot com
- Date: Tue, 12 Nov 2002 14:20:09 +0000
- Subject: Re: ARM: testsuite gcc.c-torture/execute/20020307-2.c failure
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> Looking at testcase
> gcc.c-torture/execute/20020307-2.c
>
> It seems that there is a problem with putting the arguments in the right place.
> Following peace of code
>
> void foo3()
> {
> #ifdef USE_DEFINE
> # define zzz 2
> #else
> int zzz=2;
> #endif
> struct {
> int a[zzz];
> } t;
>
> t.a[0]=1;
> t.a[1]=2;
>
> foo4(t);
> }
When a struct is of potentially variable size (from the viewpoint of the
callee), then the argument has to be passed by reference (we can't put it
into the registers since it would mess up dereferencing everything else).
Whether the reference is to the original (forcing callee copy semantics)
or to a copy (caller-copy semantics) is something we have to decide on --
I'm inclined to require caller-copy.
The whole testcase is very much dependent on the GNU variable-sized array
extension (you just can't do this in ISO C -- even in C99) so I haven't
worried about it too much until now.
R.