Invalid RegNum error

I’m writing a compiler using LLVM, and suddenly today I started to get this error, when emitting to a .s file.

Assertion failed: (I != M+Size && I->FromReg == RegNum && “Invalid RegNum”), function getLLVMRegNum, file MCRegisterInfo.cpp, line 78.

I’m emitting using x86_64-apple-darwin. Any thoughts about what could be causing this? LLVM validation does not report any errors.

Timothy

I tried updating the llvm version I’m using to LLVM-3.5svn, and now I get this error:

Not 16-bit, 32-bit or 64-bit mode!
UNREACHABLE executed at X86Subtarget.cpp:490!

Not 16-bit, 32-bit or 64-bit mode!
UNREACHABLE executed at X86Subtarget.cpp:490!

That looks like a symptom of the triple not being set properly. The
mode is set based on it, and doesn't seem to be altered elsewhere.
What happens if you put a breakpoint on X86Subtarget::X86Subtarget?
What gets passed in as the Triple string?

I'm afraid I don't recognise the earlier problem. If it happens on
trunk after you've sorted the triple thing then the best idea is to
try and reproduce it with a .ll file and llc to do the compiling. If
you can send information like that to the list, simple problems like
assertions are usually fixed quite quickly.

Cheers.

Tim.