Closed llvmbot closed 8 years ago
Fixed in r267551.
Hi,
I bumped into exact same issue with setjmp a couple of days ago. The fix has already been submitted to the Phabricator (http://reviews.llvm.org/D19409), so I'm just waiting for it to be reviewed.
Andrey, in r261429 you enabled the LEA optimization pass by default, can you please have a look?
Minimized test case is just one line:
x0() { __builtin_setjmp(1); }
To reproduce the bug, compile with:
clang -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -Os -w testcase.c
The -Os option is relevant, -O1 or -O2 do not trigger the bug.
Reproduces with trunk r266775. The emitted error is:
Invalid address displacement operand UNREACHABLE executed at /share/dim/src/llvm/trunk/lib/Target/X86/X86OptimizeLEAs.cpp:150!
Backtrace:
Extended Description
Trying to build ruby-2.3.0 with clang 3.9.0 (trunk 267338). So far, I've been unsucessful:
0 0x00007fe0594a8fb5 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/tools/bin/../lib/libLLVM-3.9svn.so+0x40bfb5)
1 0x00007fe0594a6ccd llvm::sys::RunSignalHandlers() (/tools/bin/../lib/libLLVM-3.9svn.so+0x409ccd)
2 0x00007fe0594a6e96 SignalHandler(int) (/tools/bin/../lib/libLLVM-3.9svn.so+0x409e96)
3 0x00007fe0584942d0 __restore_rt (/tools/bin/../lib/libc.so.6+0x332d0)
4 0x00007fe05a339554 (anonymous namespace)::OptimizeLEAPass::runOnMachineFunction(llvm::MachineFunction&) [clone .part.104] (/tools/bin/../lib/libLLVM-3.9svn.so+0x129c554)
5 0x00007fe0596bf2b7 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/tools/bin/../lib/libLLVM-3.9svn.so+0x6222b7)
6 0x00007fe059562568 llvm::FPPassManager::runOnFunction(llvm::Function&) (/tools/bin/../lib/libLLVM-3.9svn.so+0x4c5568)
7 0x00007fe0595628cb llvm::FPPassManager::runOnModule(llvm::Module&) (/tools/bin/../lib/libLLVM-3.9svn.so+0x4c58cb)
8 0x00007fe059562bea llvm::legacy::PassManagerImpl::run(llvm::Module&) (/tools/bin/../lib/libLLVM-3.9svn.so+0x4c5bea)
9 0x000000000060b38b clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout const&, llvm::Module, clang::BackendAction, llvm::raw_pwrite_stream) (/tools/bin/clang-3.9+0x60b38b)
10 0x0000000000974f07 (/tools/bin/clang-3.9+0x974f07)
11 0x00000000009876ba clang::ParseAST(clang::Sema&, bool, bool) (/tools/bin/clang-3.9+0x9876ba)
12 0x00000000008f3739 clang::FrontendAction::Execute() (/tools/bin/clang-3.9+0x8f3739)
13 0x00000000008c7da6 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/tools/bin/clang-3.9+0x8c7da6)
14 0x0000000000973e6a clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/tools/bin/clang-3.9+0x973e6a)
15 0x00000000005cb038 cc1_main(llvm::ArrayRef<char const>, char const, void*) (/tools/bin/clang-3.9+0x5cb038)
16 0x00000000005c74d7 main (/tools/bin/clang-3.9+0x5c74d7)
17 0x00007fe058481771 __libc_start_main (/tools/bin/../lib/libc.so.6+0x20771)
18 0x00000000005c9179 _start (/tools/bin/clang-3.9+0x5c9179)
Stack dump:
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang-3.9: note: diagnostic msg: /tmp/eval-bb65b5.c clang-3.9: note: diagnostic msg: /tmp/eval-bb65b5.sh
Clang was compiled with cmake options which can be found at:
https://github.com/elkrejzi/system-management/blob/master/bootstrap/039-llvm#L13
It was compiled with GNU GCC version 6.0.1 20160421 (prerelease).
Ruby was compiled with ./configure --prefix=/usr --disable-static --enable-shared --disable-install-capi, while also using CFLAGS="-march=skylake -fomit-frame-pointer -Os -pipe" and clang as a compiler.
clang 3.8.0 works fine (with addition of -mno-avx512f to CFLAGS because 3.8 has -march=skylake which targets AVX-512 systems which this CPU doesn't have).
Mentioned files are attached. Let me know if you need more info