[llvm-bugs] [Bug 26101] New: clang crashes on x86_64-linux-gnu running pass 'X86 Assembly / Object Emitter'

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jan 9 22:06:33 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=26101

            Bug ID: 26101
           Summary: clang crashes  on x86_64-linux-gnu running pass 'X86
                    Assembly / Object Emitter'
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: helloqirun at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

The current clang trunk crashes when compiling the following test case on
x86_64-linux-gnu in both 32-bit and 64-bit modes.


$ clang-trunk -v
clang version 3.8.0 (trunk 257159)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.1
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64



$ clang-trunk -c abc.c
abc.c:1:22: error: invalid instruction mnemonic 'frchg'
void fn1() { __asm__("frchg; fmov.s @%0fr0 frchg"); }
                     ^
<inline asm>:1:2: note: instantiated into assembly here
        frchg; fmov.s @%0fr0 frchg
        ^~~~~~
clang: /home/absozero/trunk/llvm/lib/MC/MCContext.cpp:114: llvm::MCSymbol
*llvm::MCContext::getOrCreateSymbol(const llvm::Twine &): Assertion
`!NameRef.empty() && "Normal symbols cannot be unnamed!"' failed.
#0 0x000000000304f3e8 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/absozero/trunk/root-clang/bin/clang+0x304f3e8)
#1 0x000000000304fb57 (/home/absozero/trunk/root-clang/bin/clang+0x304fb57)
#2 0x00007f0b8cc9f340 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10340)
#3 0x00007f0b8bcb3cc9 gsignal
/build/buildd/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#4 0x00007f0b8bcb70d8 abort /build/buildd/eglibc-2.19/stdlib/abort.c:91:0
#5 0x00007f0b8bcacb86 __assert_fail_base
/build/buildd/eglibc-2.19/assert/assert.c:92:0
#6 0x00007f0b8bcacc32 (/lib/x86_64-linux-gnu/libc.so.6+0x2fc32)
#7 0x0000000002e104e8 (/home/absozero/trunk/root-clang/bin/clang+0x2e104e8)
#8 0x0000000002d87c26 (/home/absozero/trunk/root-clang/bin/clang+0x2d87c26)
#9 0x0000000002d865a6 (/home/absozero/trunk/root-clang/bin/clang+0x2d865a6)
#10 0x00000000022c5af6 (/home/absozero/trunk/root-clang/bin/clang+0x22c5af6)
#11 0x00000000022bfba1 (/home/absozero/trunk/root-clang/bin/clang+0x22bfba1)
#12 0x00000000022b8723 (/home/absozero/trunk/root-clang/bin/clang+0x22b8723)
#13 0x0000000002d89c2a (/home/absozero/trunk/root-clang/bin/clang+0x2d89c2a)
#14 0x0000000002d82f75 (/home/absozero/trunk/root-clang/bin/clang+0x2d82f75)
#15 0x00000000026056a4 llvm::AsmPrinter::EmitInlineAsm(llvm::StringRef,
llvm::MCSubtargetInfo const&, llvm::MCTargetOptions const&, llvm::MDNode
const*, llvm::InlineAsm::AsmDialect) const
(/home/absozero/trunk/root-clang/bin/clang+0x26056a4)
#16 0x0000000002606df7 llvm::AsmPrinter::EmitInlineAsm(llvm::MachineInstr
const*) const (/home/absozero/trunk/root-clang/bin/clang+0x2606df7)
#17 0x00000000025f6a5c llvm::AsmPrinter::EmitFunctionBody()
(/home/absozero/trunk/root-clang/bin/clang+0x25f6a5c)
#18 0x00000000022d3de8 (/home/absozero/trunk/root-clang/bin/clang+0x22d3de8)
#19 0x00000000026f7ae9
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/home/absozero/trunk/root-clang/bin/clang+0x26f7ae9)
#20 0x0000000002f950d4 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/absozero/trunk/root-clang/bin/clang+0x2f950d4)
#21 0x0000000002f9531b llvm::FPPassManager::runOnModule(llvm::Module&)
(/home/absozero/trunk/root-clang/bin/clang+0x2f9531b)
#22 0x0000000002f957e5 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/absozero/trunk/root-clang/bin/clang+0x2f957e5)
#23 0x0000000000a0c41d clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions
const&, llvm::StringRef, llvm::Module*, clang::BackendAction,
llvm::raw_pwrite_stream*, std::unique_ptr<llvm::FunctionInfoIndex,
std::default_delete<llvm::FunctionInfoIndex> >)
(/home/absozero/trunk/root-clang/bin/clang+0xa0c41d)
#24 0x00000000009ecadb (/home/absozero/trunk/root-clang/bin/clang+0x9ecadb)
#25 0x0000000000ca1056 clang::ParseAST(clang::Sema&, bool, bool)
(/home/absozero/trunk/root-clang/bin/clang+0xca1056)
#26 0x000000000077f905 clang::FrontendAction::Execute()
(/home/absozero/trunk/root-clang/bin/clang+0x77f905)
#27 0x00000000007477f1
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/absozero/trunk/root-clang/bin/clang+0x7477f1)
#28 0x000000000072630c
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/absozero/trunk/root-clang/bin/clang+0x72630c)
#29 0x000000000071c1c8 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/home/absozero/trunk/root-clang/bin/clang+0x71c1c8)
#30 0x00000000007249b3 main
(/home/absozero/trunk/root-clang/bin/clang+0x7249b3)
#31 0x00007f0b8bc9eec5 __libc_start_main
/build/buildd/eglibc-2.19/csu/libc-start.c:321:0
#32 0x000000000071bc64 _start
(/home/absozero/trunk/root-clang/bin/clang+0x71bc64)
Stack dump:
0.    Program arguments: /home/absozero/trunk/root-clang/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
abc.c -mrelocation-model static -mthread-model posix -mdisable-fp-elim
-fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables
-fuse-init-array -target-cpu x86-64 -target-linker-version 2.24
-dwarf-column-info -debugger-tuning=gdb -coverage-file
/home/absozero/projects/reduction/abc.c -resource-dir
/home/absozero/trunk/root-clang/bin/../lib/clang/3.8.0 -c-isystem
/usr/local/include/csmith-2.3.0 -c-isystem . -cxx-isystem
/usr/local/include/csmith-2.3.0 -cxx-isystem . -internal-isystem
/usr/local/include -internal-isystem
/home/absozero/trunk/root-clang/bin/../lib/clang/3.8.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdebug-compilation-dir /home/absozero/projects/reduction -ferror-limit 19
-fmessage-length 172 -fobjc-runtime=gcc -fdiagnostics-show-option
-fcolor-diagnostics -o abc.o -x c abc.c
1.    <eof> parser at end of file
2.    Code generation
3.    Running pass 'Function Pass Manager' on module 'abc.c'.
4.    Running pass 'X86 Assembly / Object Emitter' on function '@fn1'
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 257159)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/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/abc-991f74.c
clang: note: diagnostic msg: /tmp/abc-991f74.sh
clang: note: diagnostic msg:

********************


$ cat abc.c
void fn1() { __asm__("frchg; fmov.s @%0fr0 frchg"); }

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160110/d4f1d6cf/attachment.html>


More information about the llvm-bugs mailing list