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: ARM: testsuite gcc.c-torture/execute/20020307-2.c failure


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


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