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

Chris Lattner
2006-09-20T18:27:43Z

On Wed, 20 Sep 2006, Samuele Pedroni wrote:
> The C backend can currently (recent head) produce code with such patterns:
> 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?

This looks like a bug, please file it (including the .ll file) in
bugzilla.

Thanks!

-Chris


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

-Chris

--