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

Hi,

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?

Thanks,
Guoliang

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,

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

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

Reported at http://llvm.org/bugs/show_bug.cgi?id=7761