Samuele Pedroni
2006-Sep-20 15:39 UTC
[LLVMdev] bug? c backend produces code rejected by gcc4.0.1: array type has incomplete element type
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 }
Bill Wendling
2006-Sep-20 18:04 UTC
[LLVMdev] bug? c backend produces code rejected by gcc4.0.1: array type has incomplete element type
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 >
Bill Wendling
2006-Sep-20 18:06 UTC
[LLVMdev] bug? c backend produces code rejected by gcc4.0.1: array type has incomplete element type
Ignore what I just said. I was looking at the wrong problem...Sorr... -bw On 9/20/06, Bill Wendling <isanbard at gmail.com> wrote:> 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 > > >
Chris Lattner
2006-Sep-20 18:27 UTC
[LLVMdev] bug? c backend produces code rejected by gcc4.0.1: array type has incomplete element type
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 -- http://nondot.org/sabre/ http://llvm.org/
Samuele Pedroni
2006-Sep-20 19:02 UTC
[LLVMdev] bug? c backend produces code rejected by gcc4.0.1: array type has incomplete element type
Chris Lattner wrote:> 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. > >done. <http://llvm.org/bugs/show_bug.cgi?id=918>
Seemingly Similar Threads
- [LLVMdev] bug? c backend produces code rejected by gcc4.0.1: array type has incomplete element type
- [LLVMdev] bug? c backend produces code rejected by gcc4.0.1: array type has incomplete element type
- [LLVMdev] llc c backend can produce code that doesn't compile on gcc 4.x
- [LLVMdev] llc c backend can produce code that doesn't compile on gcc 4.x
- [LLVMdev] llc c backend can produce code that doesn't compile on gcc 4.x