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 -- “One of the main causes of the fall of the Roman Empire was that–lacking zero–they had no way to indicate successful termination of their C programs.” (Robert Firth) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140117/cc3ca04d/attachment.html>
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! On Fri, Jan 17, 2014 at 3:22 PM, Timothy Baldridge <tbaldridge at gmail.com>wrote:> 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 > > -- > “One of the main causes of the fall of the Roman Empire was that–lacking > zero–they had no way to indicate successful termination of their C > programs.” > (Robert Firth) >-- “One of the main causes of the fall of the Roman Empire was that–lacking zero–they had no way to indicate successful termination of their C programs.” (Robert Firth) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140117/2ca54fec/attachment.html>
> 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.