This test started failing on the cvs head today: llc: /proj/llvm/llvm-1/include/llvm/Target/MRegisterInfo.h:236: static bool llvm::MRegisterInfo::isVirtualRegister(unsigned int): Assertion `Reg && "this is not a register!"' failed. llc((anonymous namespace)::PrintStackTrace()+0x1a)[0x886f136] llc((anonymous namespace)::SignalHandler(int)+0x110)[0x886f45e] [0x346420] /lib/libc.so.6(abort+0x101)[0x15e4f1] /lib/libc.so.6(__assert_fail+0xfd)[0x156859] llc(llvm::MRegisterInfo::isVirtualRegister(unsigned int)+0x30)[0x84e838a] llc(llvm::VirtRegMap::getStackSlot(unsigned int) const+0x11)[0x86e40eb] llc(llvm::VirtRegMap::hasStackSlot(unsigned int) const+0x18)[0x86e4146] llc[0x86e2083] llc[0x86e9396] llc[0x86cee7d] llc(llvm::MachineFunctionPass::runOnFunction(llvm::Function&)+0x28)[0x83edb7c] llc(llvm::FunctionPassManagerT::runPass(llvm::FunctionPass*, llvm::Function*)+0x1f)[0x87f25e3] llc(llvm::PassManagerT<llvm::FTraits>::runPasses(llvm::Function*, std::map<llvm::Pass*, std::vector<llvm::Pass*, std::allocator<llvm::Pass*> >, std::less<llvm::Pass*>, std::allocator<std::pair<llvm::Pass* const, std::vector<llvm::Pass*, std::allocator<llvm::Pass*> > > > >&)+0x12a)[0x8803960] llc(llvm::PassManagerT<llvm::FTraits>::runOnUnit(llvm::Function*)+0x184)[0x8806114] llc(llvm::FunctionPassManagerT::runOnFunction(llvm::Function&)+0x23)[0x87f26c5] llc(llvm::FunctionPassManager::run(llvm::Function&)+0x91)[0x87f0abb] llc(main+0x925)[0x83dcfbd] /lib/libc.so.6(__libc_start_main+0xdc)[0x14a4e4] llc(__gxx_personality_v0+0x16d)[0x83dbd61] Aborted
*** Bug 1036 has been marked as a duplicate of this bug. ***
This problem is hard to track down because it is probably dependent on memory contents. Here's how I know that: 1. It fails if it reads the test case from std in, but not if you create the bytecode before hand and pass it in on the command line to llc. 2. It doesn't fail when run under the debugger. 3. It doesn't always fail when run from the command line.
This recent patch in VirtRegMap could be to blame: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20061204/040942.html Evan?
Or possibly these: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20061204/040943.html (likely) http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20061204/040950.html (very unlikely) http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20061204/040906.html (very unlikely)
This is now breaking the llvm-gcc build: /proj/llvm/cfe/build-3/gcc/xgcc -B/proj/llvm/cfe/build-3/gcc/ -B/proj/llvm/cfe/install-3/i686-pc-linux-gnu/bin/ -B/proj/llvm/cfe/install-3/i686-pc-linux-gnu/lib/ -isystem /proj/llvm/cfe/install-3/i686-pc-linux-gnu/include -isystem /proj/llvm/cfe/install-3/i686-pc-linux-gnu/sys-include -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I. -I../../src-3/gcc -I../../src-3/gcc/. -I../../src-3/gcc/../include -I../../src-3/gcc/../libcpp/include -I/proj/llvm/llvm-3/include -I/proj/llvm/llvm-3/include -Dmalloc=kern_os_malloc -Dfree=kern_os_free -DLIBCC_KEXT -static -fno-pic -fno-exceptions -fno-non-call-exceptions -DL_gcov_merge_single -c ../../src-3/gcc/libgcov.c -o libgcc/kext/_gcov_merge_single.o In file included from ../../src-3/gcc/gcov-io.h:239, from ../../src-3/gcc/libgcov.c:51: ./auto-host.h:257:1: warning: "HAVE_DECL_GETOPT" redefined In file included from ../../src-3/gcc/libgcov.c:37: ../../src-3/gcc/tsystem.h:40:1: warning: this is the location of the previous definition cc1: VirtRegMap.h:117: int llvm::VirtRegMap::getStackSlot(unsigned int) const: Assertion `MRegisterInfo::isVirtualRegister(virtReg)' failed. ../../src-3/gcc/unwind-dw2-fde-glibc.c: At top level: ../../src-3/gcc/unwind-dw2-fde-glibc.c:426: internal compiler error: Aborted Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://llvm.org/bugs> for instructions.
It turns out that this patch: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20061204/040942.html was the cause of the problem. I've reverted it. Evan: please test your patches with at least llvm/test before committing.
First of all. I did run the dejagnu tests. Everything passes for me. I've tried the test with both Mac and Linux triple. Passes everytime. As you sugggested, it could be a memory related issue. Your fix is not right. That change is not wrong. It's possible that it could have exposed bugs everywhere. I'll run some more tests after I re-commit it.
That's weird. It fails for me every time when the input to llc is stdin, as in the test case. It doesn't fail if the input is read from a file. I imagine you didn't try this on Linux. It could be Linux specific. As for the patch, reverting it made it not fail. I tried it several times. If you're inclined to re-apply the patch, please note that it will break my llvm-gcc4 build as noted above. If you have other patch ideas, please attach here and I'll try them out before committing to the repository. Thanks, Evan.
Works okay now, Evan. Thanks!