ARM: testsuite gcc.c-torture/execute/20020307-2.c failure

Richard Earnshaw rearnsha@arm.com
Tue Nov 12 08:07:00 GMT 2002


> 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.



More information about the Gcc mailing list