[LLVMdev] LLVM ERROR: Invalid primitive type.. Is this a bug?

Duncan Sands baldrick at free.fr
Thu Jul 29 00:36:30 PDT 2010


> I have:
> int main()
> {
>     int i = 1;
> }
> in test.c.
>
> Then:
> llvm-gcc -emit-llvm -O0 -c test.c -o test.bc -g
> llc -march=cpp test.bc
> gives me:
> LLVM ERROR: Invalid primitive type
>
> This only happens when I use the "-g". Is this a bug?

Yes, it is a bug.  In fact LLVM from subversion from a few days ago
crashes even without -march=cpp:

$ llc test.bc
llc: llvm/include/llvm/Support/Casting.h:202: typename llvm::cast_retty<To, 
From>::ret_type llvm::cast(const Y&) [with X = llvm::MDNode, Y = llvm::Value*]: 
Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.

Please open a bugreport at http://llvm.org/bugs

Ciao,

Duncan.



More information about the llvm-dev mailing list