[llvm-commits] [llvm-gcc-4.2] r46381 - in /llvm-gcc-4.2/trunk/gcc: llvm-abi.h llvm-internal.h llvm-types.cpp

Bill Wendling isanbard at gmail.com
Sun Jan 27 01:14:18 PST 2008


On Jan 27, 2008, at 1:03 AM, Duncan Sands wrote:

> Hi Evan,
>
>> Can you get me a test case? I need to see what gcc is doing. Thanks,
>
> Sure.  Zero sized fields in structs may not be very useful, but it is
> still legal to use them, in particular you can take their address,
> like this:
>
> struct Z {};
>
> struct Y {
>         int i;
>         struct Z z;
> };
>
> void *f(struct Y *y) {
>   return &y->z;
> }
>
> This used to work before your patch.  For that matter, llvm-gcc-4.2
> itself fails to build here (linux x86-32; crashes compiling  
> libgcov.c) for
> what looks to be the same reason.  Also, don't forget that Ada can  
> have
> fields of variable size in various places in a struct, and these  
> can be
> represented by zero-size LLVM fields (this kind of struct doesn't get
> passed to functions by copy though).
>
> Can you please explain why you made this change (a testcase would be
> good).
>
I'm running into this problem as well -- it crashing while compiling  
gcov.c on my PPC G4.

-bw



More information about the llvm-commits mailing list