https://llvm.org/bugs/show_bug.cgi?id=25317
Bug ID: 25317 Summary: ARM asm fails with a compiler crash. Product: new-bugs Version: trunk Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: new bugs Assignee: unassignedb...@nondot.org Reporter: r...@pennware.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified Created attachment 15161 --> https://llvm.org/bugs/attachment.cgi?id=15161&action=edit Shell script and .c file. I'm trying to build Linux with clang and I ran in to a clang crash with the following test code: [~] dev% cat /tmp/bug-f5a092.c # 1 "<built-in>" # 1 "bug.c" void crash_setup_regs() { int i15, i16, i13, i14, i0; __asm__ __volatile__ ( "stmia %[regs_base], {r0-r12}\n\t" "mov %[_ARM_sp], sp\n\t" "str lr, %[_ARM_lr]\n\t" "adr %[_ARM_pc], 1f\n\t" "mrs %[_ARM_cpsr], cpsr\n\t" "1:" : [_ARM_pc] "=r" (i15), [_ARM_cpsr] "=r" (i16), [_ARM_sp] "=r" (i13), [_ARM_lr] "=o" (i14) : [regs_base] "r" (&i0) : "memory" ); } The error is: [~] dev% "/home/rich/llvm-dir/bin/clang" -target armv7-linux-gnueabihf -S bug.c clang: /home/rich/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:6359: void llvm::SelectionDAGBuilder::visitInlineAsm(llvm::ImmutableCallSite): Assertion `ConstraintID != InlineAsm::Constraint_Unknown && "Failed to convert memory constraint code to constraint id."' failed. #0 0x30355c5 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/home/rich/llvm-dir/bin/clang+0x30355c5) #1 0x30346a6 llvm::sys::RunSignalHandlers() (/home/rich/llvm-dir/bin/clang+0x30346a6) #2 0x30348c4 (/home/rich/llvm-dir/bin/clang+0x30348c4) #3 0x37bf6100d0 __restore_rt (/lib64/libpthread.so.0+0x37bf6100d0) #4 0x37bea348d7 __GI_raise (/lib64/libc.so.6+0x37bea348d7) #5 0x37bea3653a __GI_abort (/lib64/libc.so.6+0x37bea3653a) #6 0x37bea2d47d __assert_fail_base (/lib64/libc.so.6+0x37bea2d47d) #7 0x37bea2d532 (/lib64/libc.so.6+0x37bea2d532) #8 0x25ddfc0 llvm::SelectionDAGBuilder::visitInlineAsm(llvm::ImmutableCallSite) (/home/rich/llvm-dir/bin/clang+0x25ddfc0) #9 0x25eca46 llvm::SelectionDAGBuilder::visitCall(llvm::CallInst const&) (/home/rich/llvm-dir/bin/clang+0x25eca46) #10 0x25eed2a llvm::SelectionDAGBuilder::visit(llvm::Instruction const&) (/home/rich/llvm-dir/bin/clang+0x25eed2a) #11 0x25fe658 llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::Instruction const>, llvm::ilist_iterator<llvm::Instruction const>, bool&) (/home/rich/llvm-dir/bin/clang+0x25fe658) #12 0x2602277 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/home/rich/llvm-dir/bin/clang+0x2602277) #13 0x2603e10 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/home/rich/llvm-dir/bin/clang+0x2603e10) #14 0x2194274 (/home/rich/llvm-dir/bin/clang+0x2194274) #15 0x2fa7ca3 llvm::FPPassManager::runOnFunction(llvm::Function&) (/home/rich/llvm-dir/bin/clang+0x2fa7ca3) #16 0x2fa82eb llvm::legacy::PassManagerImpl::run(llvm::Module&) (/home/rich/llvm-dir/bin/clang+0x2fa82eb) #17 0xc85ff3 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::raw_pwrite_stream*) (/home/rich/llvm-dir/bin/clang+0xc85ff3) #18 0xc6578d (/home/rich/llvm-dir/bin/clang+0xc6578d) #19 0xe9935d clang::ParseAST(clang::Sema&, bool, bool) (/home/rich/llvm-dir/bin/clang+0xe9935d) #20 0xc663fb clang::CodeGenAction::ExecuteAction() (/home/rich/llvm-dir/bin/clang+0xc663fb) #21 0xa7c086 clang::FrontendAction::Execute() (/home/rich/llvm-dir/bin/clang+0xa7c086) #22 0xa54f49 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/home/rich/llvm-dir/bin/clang+0xa54f49) #23 0xa38f03 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/home/rich/llvm-dir/bin/clang+0xa38f03) #24 0xa30248 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/home/rich/llvm-dir/bin/clang+0xa30248) #25 0x9f06c3 main (/home/rich/llvm-dir/bin/clang+0x9f06c3) #26 0x37bea1ffe0 __libc_start_main (/lib64/libc.so.6+0x37bea1ffe0) #27 0xa2ece7 _start (/home/rich/llvm-dir/bin/clang+0xa2ece7) Stack dump: 0. Program arguments: /home/rich/llvm-dir/bin/clang -cc1 -triple armv7--linux-gnueabihf -S -disable-free -main-file-name bug.c -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -target-cpu cortex-a8 -target-abi aapcs-linux -mfloat-abi hard -target-linker-version 2.24 -dwarf-column-info -coverage-file /home/rich/bug.c -resource-dir /home/rich/llvm-dir/bin/../lib/clang/3.8.0 -internal-isystem /usr/local/include -internal-isystem /home/rich/llvm-dir/bin/../lib/clang/3.8.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdebug-compilation-dir /home/rich -ferror-limit 19 -fmessage-length 81 -fallow-half-arguments-and-returns -fno-signed-char -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o bug.s -x c bug.c 1. <eof> parser at end of file 2. Code generation 3. Running pass 'Function Pass Manager' on module 'bug.c'. 4. Running pass 'ARM Instruction Selection' on function '@crash_setup_regs' clang: error: unable to execute command: Aborted (core dumped) clang: error: clang frontend command failed due to signal (use -v to see invocation) clang version 3.8.0 (trunk 250619) Target: armv7--linux-gnueabihf Thread model: posix InstalledDir: /home/rich/llvm-dir/bin 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/bug-f5a092.c clang: note: diagnostic msg: /tmp/bug-f5a092.sh clang: note: diagnostic msg: ******************** [~] dev% -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs