Hello World crashes!

Hi,

Sorry for the newbie question. I downloaded llvm and tried out the
simple "Hello, World" program but got the following error. What am I
missing? I am running RHAS 3 Update 4 with GCC 3.2.3.

Thanks,

Bharadwaj

$ ./hello
lli: /home/proj/skokomish/syadaval/ia32/Sandbox/llvm/lib/Target/X86/X86CodeEmitter.cpp:208:
unsigned char ModRMByte(unsigned int, unsigned int, unsigned int):
Assertion `Mod < 4 && RegOpcode < 8 && RM < 8 && "ModRM Fields out of
range!"' failed.
lli((anonymous namespace)::PrintStackTrace()+0x15)[0x84ab499]
/lib/tls/libc.so.6[0x3d7ec8]
/lib/tls/libc.so.6(abort+0x15)[0x3d94f5]
/lib/tls/libc.so.6[0x3d1619]
lli((anonymous namespace)::Emitter::emitMemModRMByte(llvm::MachineInstr
const&, unsigned int, unsigned int)+0x219)[0x81af7c9]
Aborted

Sorry for the newbie question. I downloaded llvm and tried out the
simple "Hello, World" program but got the following error. What am I
missing? I am running RHAS 3 Update 4 with GCC 3.2.3.

That is clearly bad :). Can you file a bug report (http://llvm.org/bugs) and attach the .bc file that crashes? Please include info about what host you are running on.

Note that "hello" is actually a shell script that invokes the jit. You want to attach hello.bc.

Thanks,

-Chris

Thanks,

Bharadwaj

$ ./hello
lli: /home/proj/skokomish/syadaval/ia32/Sandbox/llvm/lib/Target/X86/X86CodeEmitter.cpp:208:
unsigned char ModRMByte(unsigned int, unsigned int, unsigned int):
Assertion `Mod < 4 && RegOpcode < 8 && RM < 8 && "ModRM Fields out of
range!"' failed.
lli((anonymous namespace)::PrintStackTrace()+0x15)[0x84ab499]
/lib/tls/libc.so.6[0x3d7ec8]
/lib/tls/libc.so.6(abort+0x15)[0x3d94f5]
/lib/tls/libc.so.6[0x3d1619]
lli((anonymous namespace)::Emitter::emitMemModRMByte(llvm::MachineInstr
const&, unsigned int, unsigned int)+0x219)[0x81af7c9]
Aborted
_______________________________________________
LLVM Developers mailing list
LLVMdev@cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-Chris

Is it possible there's a bug in GCC 3.2.3 which causes a miscompilation
and hence this crash? As a related data point, GCC 3.2.2 is known not
to compile LLVM; see http://llvm.org/docs/GettingStarted.html#brokengcc

Does your build pass the regression tests and unit tests?