<div dir="ltr">Here is a single function .ll file that reproduces the crash in CodeGenPrep. It's extracted from ICU. It still needs to be reduced, probably with bugpoint.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 16, 2014 at 4:28 PM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I plan to revert it, as the mailing lists are down and it's hard to discover these kinds of failures without them.<div><br></div><div>I'll try to get you a reproducer. There's a bad cast with this stack trace:<div><pre style="color:rgb(0,0,0)">clang: third_party/llvm/llvm/include/llvm/Support/Casting.h:237: typename cast_retty<X, Y *>::ret_type llvm::cast(Y *) [X = llvm::Instruction, Y = llvm::Value]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.

Program received signal SIGABRT, Aborted.
0x00007ffff732d6db in raise () from /usr/grte/v4/lib64/libc.so.6
(gdb) bt
#0  0x00007ffff732d6db in raise () from /usr/grte/v4/lib64/libc.so.6
#1  0x00007ffff732f3ef in abort () from /usr/grte/v4/lib64/libc.so.6
#2  0x00007ffff73262a9 in __assert_fail_base () from /usr/grte/v4/lib64/libc.so.6
#3  0x00007ffff7326353 in __assert_fail () from /usr/grte/v4/lib64/libc.so.6
#4  0x000000000059ce69 in llvm::cast_retty<llvm::Instruction, llvm::Value*>::ret_type llvm::cast<llvm::Instruction, llvm::Value>(llvm::Value*) ()
#5  0x0000000002ea8346 in (anonymous namespace)::TypePromotionHelper::promoteOperandForOther(llvm::Instruction*, (anonymous namespace)::TypePromotionTransaction&, llvm::DenseMap<llvm::Instruction*, (anonymous namespace)::TypeIsSExt, llvm::DenseMapInfo<llvm::Instruction*>, llvm::detail::DenseMapPair<llvm::Instruction*, (anonymous namespace)::TypeIsSExt> >&, unsigned int&, llvm::SmallVectorImpl<llvm::Instruction*>*, llvm::SmallVectorImpl<llvm::Instruction*>*, bool) ()
#6  0x0000000002ea7c89 in (anonymous namespace)::TypePromotionHelper::zeroExtendOperandForOther(llvm::Instruction*, (anonymous namespace)::TypePromotionTransaction&, llvm::DenseMap<llvm::Instruction*, (anonymous namespace)::TypeIsSExt, llvm::DenseMapInfo<llvm::Instruction*>, llvm::detail::DenseMapPair<llvm::Instruction*, (anonymous namespace)::TypeIsSExt> >&, unsigned int&, llvm::SmallVectorImpl<llvm::Instruction*>*, llvm::SmallVectorImpl<llvm::Instruction*>*) ()
#7  0x0000000002eaf016 in (anonymous namespace)::CodeGenPrepare::ExtLdPromotion((anonymous namespace)::TypePromotionTransaction&, llvm::LoadInst*&, llvm::Instruction*&, llvm::SmallVectorImpl<llvm::Instruction*> const&, unsigned int) ()
#8  0x0000000002e9f163 in (anonymous namespace)::CodeGenPrepare::MoveExtToFormExtLoad(llvm::Instruction*&) ()
#9  0x0000000002e9def3 in (anonymous namespace)::CodeGenPrepare::OptimizeInst(llvm::Instruction*) ()
#10 0x0000000002e9d9f6 in (anonymous namespace)::CodeGenPrepare::OptimizeBlock(llvm::BasicBlock&) ()
#11 0x0000000002e9bdb7 in (anonymous namespace)::CodeGenPrepare::runOnFunction(llvm::Function&) ()
#12 0x0000000003896a0d in llvm::FPPassManager::runOnFunction(llvm::Function&) ()
#13 0x0000000003896d18 in llvm::FPPassManager::runOnModule(llvm::Module&) ()
#14 0x00000000038973d9 in (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) ()
#15 0x0000000003896fce in llvm::legacy::PassManagerImpl::run(llvm::Module&) ()
#16 0x0000000003897881 in llvm::legacy::PassManager::run(llvm::Module&) ()
#17 0x000000000045af33 in (anonymous namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction, llvm::raw_ostream*) ()
#18 0x000000000045a862 in clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::raw_ostream*) ()
#19 0x0000000000436bb3 in clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) ()
#20 0x000000000170635b in clang::ParseAST(clang::Sema&, bool, bool) ()
#21 0x00000000013bcc29 in clang::ASTFrontendAction::ExecuteAction() ()
#22 0x00000000004347a1 in clang::CodeGenAction::ExecuteAction() ()
#23 0x00000000013bc710 in clang::FrontendAction::Execute() ()
#24 0x000000000126fc1b in clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) ()
#25 0x000000000042f4a8 in clang::ExecuteCompilerInvocation(clang::CompilerInstance*) ()
#26 0x0000000000416c67 in cc1_main(llvm::ArrayRef<char const*>, char const*, void*) ()
#27 0x0000000000426f93 in ExecuteCC1Tool(llvm::ArrayRef<char const*>, llvm::StringRef) ()</pre></div></div></div>
</blockquote></div></div>