clang (and LLVM) cannot handle the following ARM assembler. int to_int32(double d) { int i; __asm( "mov %0, %Q1\n" "add %0, %R1\n" : "=r"(i), "=&r"(d) : "1"(d) :); return i; } "Q" and "R" is assigned to high dword and low dword of double, but LLVM cannot handle this. clang: /home/makoto/Development/llvm.org/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:387: void getCopyToParts(llvm::SelectionDAG &, llvm::SDLoc, llvm::SDValue, llvm::SDValue *, unsigned int, llvm::MVT, const llvm::Value *, ISD::NodeType): Assertion `(PartVT.isInteger() || PartVT == MVT::x86mmx) && ValueVT.isInteger() && "Unknown mismatch!"' failed. 0 clang 0x00000000034ee98e llvm::sys::PrintStackTrace(_IO_FILE*) + 46 1 clang 0x00000000034eec4b 2 clang 0x00000000034eeebe 3 libpthread.so.0 0x00007f0d55565bb0 4 libc.so.6 0x00007f0d54579f77 gsignal + 55 5 libc.so.6 0x00007f0d5457d5e8 abort + 328 6 libc.so.6 0x00007f0d54572d43 7 libc.so.6 0x00007f0d54572df2 8 clang 0x0000000002a8f3f9 9 clang 0x0000000002ab7988 10 clang 0x0000000002a96aea llvm::SelectionDAGBuilder::visitInlineAsm(llvm::ImmutableCallSite) + 7322 11 clang 0x0000000002a87941 llvm::SelectionDAGBuilder::visitCall(llvm::CallInst const&) + 97 12 clang 0x0000000002a80399 llvm::SelectionDAGBuilder::visit(unsigned int, llvm::User const&) + 1097 13 clang 0x0000000002a7f8b3 llvm::SelectionDAGBuilder::visit(llvm::Instruction const&) + 131 14 clang 0x0000000002add51c llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::Instruction const>, llvm::ilist_iterator<llvm::Instruction const>, bool&) + 140 15 clang 0x0000000002add035 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 2469 16 clang 0x0000000002adb787 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 935 17 clang 0x0000000002d01ade llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 110 18 clang 0x0000000003459b5b llvm::FPPassManager::runOnFunction(llvm::Function&) + 427 19 clang 0x0000000003459e68 llvm::FPPassManager::runOnModule(llvm::Module&) + 104 20 clang 0x000000000345a26a llvm::MPPassManager::runOnModule(llvm::Module&) + 634 21 clang 0x000000000345aa1e llvm::PassManagerImpl::run(llvm::Module&) + 302 22 clang 0x000000000345ac71 llvm::PassManager::run(llvm::Module&) + 33 23 clang 0x0000000000b6db59 24 clang 0x0000000000b6d688 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::Module*, clang::BackendAction, llvm::raw_ostream*) + 104 25 clang 0x0000000000b6a6f9 26 clang 0x0000000000dcb9cd clang::ParseAST(clang::Sema&, bool, bool) + 813 27 clang 0x00000000008a1229 clang::ASTFrontendAction::ExecuteAction() + 345 28 clang 0x0000000000b69a3e clang::CodeGenAction::ExecuteAction() + 1246 29 clang 0x00000000008a0d4f clang::FrontendAction::Execute() + 191 30 clang 0x000000000086bc20 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 800 31 clang 0x000000000082db68 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1048 32 clang 0x000000000081b73a cc1_main(char const**, char const**, char const*, void*) + 698 33 clang 0x0000000000827b42 main + 802 34 libc.so.6 0x00007f0d54564de5 __libc_start_main + 245 35 clang 0x000000000081b3b9 Stack dump: 0. Program arguments: /home/makoto/Development/llvm.org/build/Debug+Asserts/bin/clang -cc1 -triple armv7-none-linux-androideabi -S -disable-free -main-file-name asm.c -mrelocation-model static -mdisable-fp-elim -fmath-errno -mconstructor-aliases -fuse-init-array -target-cpu cortex-a8 -target-feature +soft-float-abi -target-abi aapcs-linux -mfloat-abi soft -target-linker-version 2.23.52.201309 13 -coverage-file /tmp/asm-6f9de6.s -resource-dir /home/makoto/Development/llvm.org/build/Debug+Asserts/bin/../lib/clang/3.4 -internal-isystem /usr/local/include -internal-isystem /home/makoto/Development/llvm.org/build/Debug+Asserts/bin/../lib/clang/3.4/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -fno-dwarf-directory-asm -fdebug-compilation-dir /home/makoto/Development/llvm.org/build -ferror-limit 19 -fmessage-length 80 -mstackrealign -fno-signed-char -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics-vectorize-slp -o /tmp/asm-6f9de6.s -x c asm.c 1. <eof> parser at end of file 2. Code generation 3. Running pass 'Function Pass Manager' on module 'asm.c'. 4. Running pass 'ARM Instruction Selection' on function '@to_int32' clang: error: unable to execute command: Aborted (core dumped) clang: error: clang frontend command failed due to signal (use -v to see invocat ion) clang version 3.4 (trunk 193915) Target: armv7-none-linux-androideabi Thread model: posix clang: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script . clang: note: diagnostic msg: ******************** PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang: note: diagnostic msg: /tmp/asm-e4fbd1.c clang: note: diagnostic msg: /tmp/asm-e4fbd1.sh clang: note: diagnostic msg:
Mark this as a dupe of 23244, which has a nicer description. *** This bug has been marked as a duplicate of bug 23244 ***