Compiler error when self-hosting

I’ve hit this weird compiler error when building llvm/clang

$ clang --version
clang version 2.9 (trunk 125254)
Target: x86_64-apple-darwin10
Thread model: posix

Source rev is 125326

$ make
llvm[1]: Compiling APFloat.cpp for Release build
llvm[1]: Compiling APInt.cpp for Release build
llvm[1]: Compiling APSInt.cpp for Release build
llvm[1]: Compiling Allocator.cpp for Release build
llvm[1]: Compiling Atomic.cpp for Release build
llvm[1]: Compiling CommandLine.cpp for Release build
llvm[1]: Compiling ConstantRange.cpp for Release build
llvm[1]: Compiling CrashRecoveryContext.cpp for Release build
llvm[1]: Compiling DAGDeltaAlgorithm.cpp for Release build
llvm[1]: Compiling Debug.cpp for Release build
llvm[1]: Compiling DeltaAlgorithm.cpp for Release build
llvm[1]: Compiling Disassembler.cpp for Release build
llvm[1]: Compiling Dwarf.cpp for Release build
llvm[1]: Compiling DynamicLibrary.cpp for Release build
llvm[1]: Compiling Errno.cpp for Release build
llvm[1]: Compiling ErrorHandling.cpp for Release build
llvm[1]: Compiling FileUtilities.cpp for Release build
llvm[1]: Compiling FoldingSet.cpp for Release build
llvm[1]: Compiling FormattedStream.cpp for Release build
llvm[1]: Compiling GraphWriter.cpp for Release build
llvm[1]: Compiling Host.cpp for Release build
llvm[1]: Compiling IncludeFile.cpp for Release build
llvm[1]: Compiling IntEqClasses.cpp for Release build
llvm[1]: Compiling IntervalMap.cpp for Release build
llvm[1]: Compiling IsInf.cpp for Release build
llvm[1]: Compiling IsNAN.cpp for Release build
llvm[1]: Compiling ManagedStatic.cpp for Release build
llvm[1]: Compiling Memory.cpp for Release build
llvm[1]: Compiling MemoryBuffer.cpp for Release build
llvm[1]: Compiling MemoryObject.cpp for Release build
llvm[1]: Compiling Mutex.cpp for Release build
llvm[1]: Compiling Path.cpp for Release build
llvm[1]: Compiling PathV2.cpp for Release build
llvm[1]: Compiling PluginLoader.cpp for Release build
llvm[1]: Compiling PrettyStackTrace.cpp for Release build
llvm[1]: Compiling Process.cpp for Release build
llvm[1]: Compiling Program.cpp for Release build
llvm[1]: Compiling RWMutex.cpp for Release build
llvm[1]: Compiling Regex.cpp for Release build
llvm[1]: Compiling SearchForAddressOfSpecialSymbol.cpp for Release build
llvm[1]: Compiling Signals.cpp for Release build
llvm[1]: Compiling SmallPtrSet.cpp for Release build
llvm[1]: Compiling SmallVector.cpp for Release build
llvm[1]: Compiling SourceMgr.cpp for Release build
llvm[1]: Compiling Statistic.cpp for Release build
llvm[1]: Compiling StringExtras.cpp for Release build
llvm[1]: Compiling StringMap.cpp for Release build
llvm[1]: Compiling StringPool.cpp for Release build
llvm[1]: Compiling StringRef.cpp for Release build
llvm[1]: Compiling SystemUtils.cpp for Release build
llvm[1]: Compiling TargetRegistry.cpp for Release build
llvm[1]: Compiling ThreadLocal.cpp for Release build
llvm[1]: Compiling Threading.cpp for Release build
llvm[1]: Compiling TimeValue.cpp for Release build
llvm[1]: Compiling Timer.cpp for Release build
llvm[1]: Compiling ToolOutputFile.cpp for Release build
llvm[1]: Compiling Triple.cpp for Release build
llvm[1]: Compiling Twine.cpp for Release build
llvm[1]: Compiling Valgrind.cpp for Release build
llvm[1]: Compiling circular_raw_ostream.cpp for Release build
llvm[1]: Compiling raw_os_ostream.cpp for Release build
llvm[1]: Compiling raw_ostream.cpp for Release build
llvm[1]: Compiling regcomp.c for Release build
UNREACHABLE executed!
0 clang 0x0000000100c268b2 llvm::SmallVectorImpl<llvm_regmatch_t>::resize(unsigned int) + 2098
1 clang 0x0000000100c26d89 llvm::SmallVectorImpl<llvm_regmatch_t>::resize(unsigned int) + 3337
2 libSystem.B.dylib 0x00007fff86e7367a _sigtramp + 26
3 libSystem.B.dylib 0x8000006300000001 _sigtramp + 2031667617
4 clang 0x0000000100c26b06 llvm::SmallVectorImpl<llvm_regmatch_t>::resize(unsigned int) + 2694
5 clang 0x0000000100c17d62 std::_Rb_tree<std::string, std::pair<std::string const, void*>, std::_Select1st<std::pair<std::string const, void*> >, std::lessstd::string, std::allocator<std::pair<std::string const, void*> > >::_M_erase(std::_Rb_tree_node<std::pair<std::string const, void*> >) + 1410
6 clang 0x00000001008025ef llvm::DenseMap<llvm::SDNode const
, unsigned int, llvm::DenseMapInfo<llvm::SDNode const*>, llvm::DenseMapInfo >::clear() + 4543
7 clang 0x000000010080238d llvm::DenseMap<llvm::SDNode const*, unsigned int, llvm::DenseMapInfo<llvm::SDNode const*>, llvm::DenseMapInfo >::clear() + 3933
8 clang 0x00000001008018b2 llvm::DenseMap<llvm::SDNode const*, unsigned int, llvm::DenseMapInfo<llvm::SDNode const*>, llvm::DenseMapInfo >::clear() + 1154
9 clang 0x0000000100837678 llvm::SmallVectorTemplateBase<std::pair<llvm::TrackingVHllvm::MDNode, std::pair<unsigned int, llvm::DebugLoc> >, false>::grow(unsigned long) + 6296
10 clang 0x0000000100836e2f llvm::SmallVectorTemplateBase<std::pair<llvm::TrackingVHllvm::MDNode, std::pair<unsigned int, llvm::DebugLoc> >, false>::grow(unsigned long) + 4175
11 clang 0x0000000100836547 llvm::SmallVectorTemplateBase<std::pair<llvm::TrackingVHllvm::MDNode, std::pair<unsigned int, llvm::DebugLoc> >, false>::grow(unsigned long) + 1895
12 clang 0x00000001008e1e2e llvm::MachineFunctionAnalysis::getPassName() const + 142
13 clang 0x0000000100b95ba8 llvm::cl::parser<llvm::PassInfo const*>::~parser() + 19656
14 clang 0x0000000100b95e2b llvm::cl::parser<llvm::PassInfo const*>::~parser() + 20299
15 clang 0x0000000100b95fc6 llvm::cl::parser<llvm::PassInfo const*>::~parser() + 20710
16 clang 0x0000000100b96557 llvm::cl::parser<llvm::PassInfo const*>::~parser() + 22135
17 clang 0x0000000100b96a7d llvm::cl::parser<llvm::PassInfo const*>::~parser() + 23453
18 clang 0x00000001001124b6 std::_Rb_tree<clang::SwitchCase*, std::pair<clang::SwitchCase* const, unsigned int>, std::_Select1st<std::pair<clang::SwitchCase* const, unsigned int> >, std::lessclang::SwitchCase*, std::allocator<std::pair<clang::SwitchCase* const, unsigned int> > >::_M_insert_unique(std::pair<clang::SwitchCase* const, unsigned int> const&) + 6550
19 clang 0x00000001001ead35 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 261
20 clang 0x0000000100208358 clang::ABIArgInfo::setCoerceToType(llvm::Type const*) + 952
21 clang 0x00000001001ea05e llvm::DenseMap<clang::CXXRecordDecl const*, long long, llvm::DenseMapInfo<clang::CXXRecordDecl const*>, llvm::DenseMapInfo >::grow(unsigned int) + 3326
22 clang 0x0000000100054fb0 std::_Deque_base<std::string, std::allocatorstd::string >::_M_initialize_map(unsigned long) + 2864
23 clang 0x000000010003611b llvm::DenseMap<clang::IdentifierInfo const*, unsigned int, llvm::DenseMapInfo<clang::IdentifierInfo const*>, llvm::DenseMapInfo >::grow(unsigned int) + 10491
24 clang 0x0000000100016cfb std::_Rb_tree<std::string, std::string, std::_Identitystd::string, std::lessstd::string, std::allocatorstd::string >::_M_insert_unique(std::string const&) + 3723
25 clang 0x000000010000faa7 std::vector<llvm::PassRegistrationListener*, std::allocatorllvm::PassRegistrationListener* >::_M_insert_aux(__gnu_cxx::__normal_iterator<llvm::PassRegistrationListener**, std::vector<llvm::PassRegistrationListener*, std::allocatorllvm::PassRegistrationListener* > >, llvm::PassRegistrationListener* const&) + 8727
26 clang 0x0000000100013468 std::vector<llvm::SourceMgr::SrcBuffer, std::allocatorllvm::SourceMgr::SrcBuffer >::_M_insert_aux(__gnu_cxx::__normal_iterator<llvm::SourceMgr::SrcBuffer*, std::vector<llvm::SourceMgr::SrcBuffer, std::allocatorllvm::SourceMgr::SrcBuffer > >, llvm::SourceMgr::SrcBuffer const&) + 1272
27 clang 0x000000010000e464 std::vector<llvm::PassRegistrationListener*, std::allocatorllvm::PassRegistrationListener* >::_M_insert_aux(__gnu_cxx::__normal_iterator<llvm::PassRegistrationListener**, std::vector<llvm::PassRegistrationListener*, std::allocatorllvm::PassRegistrationListener* > >, llvm::PassRegistrationListener* const&) + 3028
Stack dump:
0. Program arguments: /usr/local/bin/clang -cc1 -triple x86_64-apple-darwin10.0.0 -emit-obj -disable-free -disable-llvm-verifier -main-file-name regcomp.c -pic-level 1 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 97.17 -resource-dir /usr/local/bin/…/lib/clang/2.9 -dependency-file /Users/leafy/Projects/llvm/lib/Support/Release/regcomp.d.tmp -MP -MT /Users/leafy/Projects/llvm/lib/Support/Release/regcomp.o -MT /Users/leafy/Projects/llvm/lib/Support/Release/regcomp.d -D NDEBUG -D _GNU_SOURCE -D __STDC_LIMIT_MACROS -D __STDC_CONSTANT_MACROS -I /Users/leafy/Projects/llvm/include -I /Users/leafy/Projects/llvm/lib/Support -O3 -Wall -W -Wno-unused-parameter -Wwrite-strings -ferror-limit 19 -fmessage-length 133 -stack-protector 1 -fblocks -fno-common -fdiagnostics-show-option -fcolor-diagnostics -o /Users/leafy/Projects/llvm/lib/Support/Release/regcomp.o -x c regcomp.c

  1. parser at end of file
  2. Code generation
  3. Running pass ‘Function Pass Manager’ on module ‘regcomp.c’.
  4. Running pass ‘X86 DAG->DAG Instruction Selection’ on function ‘@p_ere
    clang: error: unable to execute command: Illegal instruction
    clang: error: clang frontend command failed due to signal 1 (use -v to see invocation)
    make[1]: *** [/Users/leafy/Projects/llvm/lib/Support/Release/regcomp.o] Error 1
    make: *** [all] Error 1