[LLVMdev] bug? c backend produces code rejected by gcc4.0.1: array type has incomplete element type

Bill Wendling
2006-09-20T18:04:59Z

It seems very similar to http://llvm.org/bugs/show_bug.cgi?id=737 .
You might want to check if it's the same problem. If not, then please
create a new bug report.

-bw

On 9/20/06, Samuele Pedroni <pedronis at strakt.com>
wrote:
> The C backend can currently (recent head) produce code with such patterns:
>
> /* Global Declarations */
> /* Structure forward decls */
> struct l_structtype_s;
>
> /* Typedefs */
> typedef struct l_structtype_s l_fixarray_array3[3]; /* problematic
> declaration */
> typedef struct l_structtype_s l_structtype_s;
>
> /* Structure contents */
> struct l_structtype_s {
>   int field0;
> };
>
> gcc 4.0.1 will reject this with
>
> example.c:7: error: array type has incomplete element type
>
> this kind of code was accepted by previous versions of gcc as a fragile
> extension,
> but is no longer at least in 4.0.1 .
>
> is this known? should I file a bug?
>
> regards.
>
> PS: This code produces such a pattern through llvm-as, and llc -march=c:
>
> target endian = little
> target pointersize = 32
> target triple = "i686-apple-darwin8.7.1"
>
> %fixarray_array3 = type [3 x %structtype_s]
> %structtype_s = type { int }
>
> int %witness(%fixarray_array3* %p) {
>      %q = getelementptr %fixarray_array3* %p, uint 0, uint 0, uint 0
>      %v = load int* %q
>      ret int %v
> }
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>