[llvm-bugs] [Bug 34537] New: clang crashes on valid code at -O3 in 64-bit mode on x86_64-linux-gnu while running pass 'Machine InstCombiner': Assertion `!NodePtr->isKnownSentinel()' failed
via llvm-bugs
llvm-bugs at lists.llvm.org
Fri Sep 8 18:11:31 PDT 2017
https://bugs.llvm.org/show_bug.cgi?id=34537
Bug ID: 34537
Summary: clang crashes on valid code at -O3 in 64-bit mode on
x86_64-linux-gnu while running pass 'Machine
InstCombiner': Assertion `!NodePtr->isKnownSentinel()'
failed
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: -New Bugs
Assignee: unassignedclangbugs at nondot.org
Reporter: su at cs.ucdavis.edu
CC: llvm-bugs at lists.llvm.org
Tested with trunk revision 312826.
$ clangpolly -v
clang version 6.0.0 (http://llvm.org/git/clang.git
870b07b53115ba4d8b12cda83982b0e69badca62)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/su/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6.0.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.4
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.4
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.5
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.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.0.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$
$ clangpolly -O2 small.c; ./a.out
$
$ clangpolly -O3 small.c
clang-6.0:
/home/su/software/tmp/polly/llvm/include/llvm/ADT/ilist_iterator.h:140:
llvm::ilist_iterator<OptionsT, IsReverse, IsConst>::reference
llvm::ilist_iterator<OptionsT, IsReverse, IsConst>::operator*() const [with
OptionsT = llvm::ilist_detail::node_options<llvm::MachineInstr, true, true,
void>; bool IsReverse = false; bool IsConst = false;
llvm::ilist_iterator<OptionsT, IsReverse, IsConst>::reference =
llvm::MachineInstr&]: Assertion `!NodePtr->isKnownSentinel()' failed.
#0 0x0000000001fe5f9a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/su/software/tmp/polly/llvm/lib/Support/Unix/Signals.inc:402:0
#1 0x0000000001fe3dde llvm::sys::RunSignalHandlers()
/home/su/software/tmp/polly/llvm/lib/Support/Signals.cpp:50:0
#2 0x0000000001fe3f52 SignalHandler(int)
/home/su/software/tmp/polly/llvm/lib/Support/Unix/Signals.inc:242:0
#3 0x00007f7917bfa390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x00007f791696c428 gsignal
/build/glibc-bfm8X4/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
#5 0x00007f791696e02a abort /build/glibc-bfm8X4/glibc-2.23/stdlib/abort.c:91:0
#6 0x00007f7916964bd7 __assert_fail_base
/build/glibc-bfm8X4/glibc-2.23/assert/assert.c:92:0
#7 0x00007f7916964c82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#8 0x00000000018cb7b4
(/home/su/software/tmp/polly/llvm_build/bin/clang-6.0+0x18cb7b4)
#9 0x000000000181d564 (anonymous
namespace)::MachineCombiner::combineInstructions(llvm::MachineBasicBlock*)
[clone .constprop.89]
/home/su/software/tmp/polly/llvm/lib/CodeGen/MachineCombiner.cpp:481:0
#10 0x000000000181f1f7 (anonymous
namespace)::MachineCombiner::runOnMachineFunction(llvm::MachineFunction&)
/home/su/software/tmp/polly/llvm/lib/CodeGen/MachineCombiner.cpp:554:0
#11 0x000000000184adb5
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
/home/su/software/tmp/polly/llvm/lib/CodeGen/MachineFunctionPass.cpp:62:0
#12 0x0000000001b5d3bb llvm::FPPassManager::runOnFunction(llvm::Function&)
/home/su/software/tmp/polly/llvm/lib/IR/LegacyPassManager.cpp:1514:0
#13 0x0000000001b5d47c llvm::FPPassManager::runOnModule(llvm::Module&)
/home/su/software/tmp/polly/llvm/lib/IR/LegacyPassManager.cpp:1535:0
#14 0x0000000001b5cfbd runOnModule
/home/su/software/tmp/polly/llvm/lib/IR/LegacyPassManager.cpp:1591:0
#15 0x0000000001b5cfbd llvm::legacy::PassManagerImpl::run(llvm::Module&)
/home/su/software/tmp/polly/llvm/lib/IR/LegacyPassManager.cpp:1694:0
#16 0x0000000002184bff llvm::PrettyStackTraceString::~PrettyStackTraceString()
/home/su/software/tmp/polly/llvm/include/llvm/Support/PrettyStackTrace.h:52:0
#17 0x0000000002184bff EmitAssembly
/home/su/software/tmp/polly/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp:793:0
#18 0x0000000002184bff clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout
const&, llvm::Module*, clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
/home/su/software/tmp/polly/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp:1145:0
#19 0x00000000029799d9 std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >::~unique_ptr()
/usr/include/c++/5/bits/unique_ptr.h:235:0
#20 0x00000000029799d9
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
/home/su/software/tmp/polly/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:261:0
#21 0x0000000002b46078 void std::swap<bool>(bool&, bool&)
/usr/include/c++/5/bits/move.h:187:0
#22 0x0000000002b46078 clang::ParseAST(clang::Sema&, bool, bool)
/home/su/software/tmp/polly/llvm/tools/clang/lib/Parse/ParseAST.cpp:161:0
#23 0x0000000002978ecf clang::CodeGenAction::ExecuteAction()
/home/su/software/tmp/polly/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:993:0
#24 0x0000000002525736 clang::FrontendAction::Execute()
/home/su/software/tmp/polly/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:902:0
#25 0x00000000024f5fd6
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/home/su/software/tmp/polly/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:987:0
#26 0x00000000025b3512
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/home/su/software/tmp/polly/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:252:0
#27 0x0000000000a78308 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*)
/home/su/software/tmp/polly/llvm/tools/clang/tools/driver/cc1_main.cpp:221:0
#28 0x00000000009f64b8 ExecuteCC1Tool
/home/su/software/tmp/polly/llvm/tools/clang/tools/driver/driver.cpp:302:0
#29 0x00000000009f64b8 main
/home/su/software/tmp/polly/llvm/tools/clang/tools/driver/driver.cpp:381:0
#30 0x00007f7916957830 __libc_start_main
/build/glibc-bfm8X4/glibc-2.23/csu/../csu/libc-start.c:325:0
#31 0x0000000000a74c29 _start
(/home/su/software/tmp/polly/llvm_build/bin/clang-6.0+0xa74c29)
Stack dump:
0. Program arguments: /home/su/software/tmp/polly/llvm_build/bin/clang-6.0
-cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name
small.c -mrelocation-model static -mthread-model posix -fmath-errno
-masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array
-target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb
-momit-leaf-frame-pointer -resource-dir
/home/su/software/tmp/polly/llvm_build/lib/clang/6.0.0 -internal-isystem
/usr/local/include -internal-isystem
/home/su/software/tmp/polly/llvm_build/lib/clang/6.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O3
-fdebug-compilation-dir /home/su -ferror-limit 19 -fmessage-length 116
-fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics
-vectorize-loops -vectorize-slp -o /tmp/small-7b41b8.o -x c small.c
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module 'small.c'.
4. Running pass 'Machine InstCombiner' on function '@foo'
clang-6.0: error: unable to execute command: Aborted (core dumped)
clang-6.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 6.0.0 (http://llvm.org/git/clang.git
870b07b53115ba4d8b12cda83982b0e69badca62)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/su/bin
clang-6.0: 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-6.0: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-6.0: note: diagnostic msg: /tmp/small-0b78ab.c
clang-6.0: note: diagnostic msg: /tmp/small-0b78ab.sh
clang-6.0: note: diagnostic msg:
********************
$
--------------------------------------
int a, b, c, d, e, f, g;
void foo ()
{
for (g = 0; g < 10; g++)
{
for (b = 0; b < 10; b++)
e |= (c-- > 0) > d;
if (a)
continue;
e = f;
}
}
int main ()
{
foo ();
return 0;
}
--
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/20170909/4a8d3ac1/attachment-0001.html>
More information about the llvm-bugs
mailing list