Clang bug with C99 array as parameter

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Clang bug with C99 array as parameter

Mark Bertsch
Dear all,

I do not know if this bug is already known:
With clang trunk (r110038) the following call fails:
clang test.c

with test.c:
void function(short width, int data[][width]) {}
void test() {
     function(1, 0);
}

I get an assertion in CodeGen:
/clang_trunk/cmake/bin/clang test.c
clang: /clang_trunk/llvm/tools/clang/lib/CodeGen/CGExpr.cpp:1167:
clang::CodeGen::LValue
clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(const
clang::DeclRefExpr*): Assertion `V && "DeclRefExpr not entered in
LocalDeclMap?"' failed.
Stack dump:
0.      Program arguments: /clang_trunk/cmake/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -S -disable-free -main-file-name test.c
-mrelocation-model static -mdisable-fp-elim -mconstructor-aliases
-munwind-tables -target-cpu x86-64 -resource-dir
/clang_trunk/cmake/lib/clang/2.8 -ferror-limit 19 -fmessage-length 80
-fgnu-runtime -fdiagnostics-show-option -fcolor-diagnostics -o
/tmp/cc-CFGwvn.s -x c test.c
1.      <eof> parser at end of file
2.      test.c:2:6: LLVM IR generation of declaration 'test'
3.      test.c:2:6: Generating code for declaration 'test'
4.      test.c:2:13: LLVM IR generation of compound statement ('{}')
clang: error: clang frontend command failed due to signal 6 (use -v to
see invocation)

Also let mt thank you for your great compiler!
Mark

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Clang bug with C99 array as parameter

John McCall
On Aug 3, 2010, at 4:49 AM, Mark Bertsch wrote:
> I do not know if this bug is already known:
> With clang trunk (r110038) the following call fails:
> clang test.c
>
> with test.c:
> void function(short width, int data[][width]) {}
> void test() {
>     function(1, 0);
> }

Very interesting!  I looked into it, and there isn't a quick fix.  Please file a bug.

John.
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Clang bug with C99 array as parameter

Mark Bertsch
John McCall wrote:

> On Aug 3, 2010, at 4:49 AM, Mark Bertsch wrote:
>> I do not know if this bug is already known:
>> With clang trunk (r110038) the following call fails:
>> clang test.c
>>
>> with test.c:
>> void function(short width, int data[][width]) {}
>> void test() {
>>     function(1, 0);
>> }
>
> Very interesting!  I looked into it, and there isn't a quick fix.  Please file a bug.
>
> John.

(again for everybody:)

Ok, filed as:
http://llvm.org/bugs/show_bug.cgi?id=7827

Mark
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev