[llvm-bugs] [Bug 36602] New: clang crashes on valid code at -O1 and above: UNREACHABLE executed at /home/su/software/tmp/polly/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp:476!
via llvm-bugs
llvm-bugs at lists.llvm.org
Mon Mar 5 13:36:01 PST 2018
https://bugs.llvm.org/show_bug.cgi?id=36602
Bug ID: 36602
Summary: clang crashes on valid code at -O1 and above:
UNREACHABLE executed at
/home/su/software/tmp/polly/llvm/lib/CodeGen/Selection
DAG/LegalizeTypes.cpp:476!
Product: clang
Version: unspecified
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 326694.
$ clangpolly -v
clang version 7.0.0 (http://llvm.org/git/clang.git
26d4516ed3de4e70527ed6dd1b122ff03a3a7ba5) (http://llvm.org/git/llvm.git
022e5fa26f94e30bf52bcd4bfa4c72492ae2f23d)
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 -O0 -c small.c
$
$ clangpolly -O1 -c small.c
Operand not processed?
t25: ch = br t27, BasicBlock:ch<lor.rhs7 0x919fae8>
UNREACHABLE executed at
/home/su/software/tmp/polly/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp:476!
#0 0x00000000021b376a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/su/software/tmp/polly/llvm/lib/Support/Unix/Signals.inc:402:0
#1 0x00000000021b15fe llvm::sys::RunSignalHandlers()
/home/su/software/tmp/polly/llvm/lib/Support/Signals.cpp:50:0
#2 0x00000000021b1772 SignalHandler(int)
/home/su/software/tmp/polly/llvm/lib/Support/Unix/Signals.inc:242:0
#3 0x00007f9e50248390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x00007f9e4efba428 gsignal
/build/glibc-bfm8X4/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
#5 0x00007f9e4efbc02a abort /build/glibc-bfm8X4/glibc-2.23/stdlib/abort.c:91:0
#6 0x000000000216714a
(/home/su/software/tmp/polly/llvm_build/bin/clang-6.0+0x216714a)
#7 0x0000000002b3ee29 llvm::SDNode::getNumOperands() const
/home/su/software/tmp/polly/llvm/include/llvm/CodeGen/SelectionDAGNodes.h:829:0
#8 0x0000000002b3ee29 llvm::DAGTypeLegalizer::run()
/home/su/software/tmp/polly/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp:453:0
#9 0x0000000002b3f53a llvm::SmallVectorTemplateCommon<llvm::SDNode*,
void>::begin()
/home/su/software/tmp/polly/llvm/include/llvm/ADT/SmallVector.h:116:0
#10 0x0000000002b3f53a llvm::SmallVector<llvm::SDNode*, 128u>::~SmallVector()
/home/su/software/tmp/polly/llvm/include/llvm/ADT/SmallVector.h:871:0
#11 0x0000000002b3f53a llvm::DAGTypeLegalizer::~DAGTypeLegalizer()
/home/su/software/tmp/polly/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h:32:0
#12 0x0000000002b3f53a llvm::SelectionDAG::LegalizeTypes()
/home/su/software/tmp/polly/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp:1187:0
#13 0x0000000002b018e1 llvm::TimeRegion::~TimeRegion()
/home/su/software/tmp/polly/llvm/include/llvm/Support/Timer.h:152:0
#14 0x0000000002b018e1 llvm::NamedRegionTimer::~NamedRegionTimer()
/home/su/software/tmp/polly/llvm/include/llvm/Support/Timer.h:160:0
#15 0x0000000002b018e1 llvm::SelectionDAGISel::CodeGenAndEmitDAG()
/home/su/software/tmp/polly/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:760:0
#16 0x0000000002b0c1aa
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&)
/home/su/software/tmp/polly/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1632:0
#17 0x0000000002b0e119
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) [clone
.part.878] [clone .constprop.902]
/home/su/software/tmp/polly/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:467:0
#18 0x000000000153a434 (anonymous
namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&)
/home/su/software/tmp/polly/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:177:0
#19 0x00000000019b1925
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
/home/su/software/tmp/polly/llvm/lib/CodeGen/MachineFunctionPass.cpp:62:0
#20 0x0000000001ce825b llvm::FPPassManager::runOnFunction(llvm::Function&)
/home/su/software/tmp/polly/llvm/lib/IR/LegacyPassManager.cpp:1520:0
#21 0x0000000001ce831c llvm::FPPassManager::runOnModule(llvm::Module&)
/home/su/software/tmp/polly/llvm/lib/IR/LegacyPassManager.cpp:1541:0
#22 0x0000000001ce7e5d runOnModule
/home/su/software/tmp/polly/llvm/lib/IR/LegacyPassManager.cpp:1597:0
#23 0x0000000001ce7e5d llvm::legacy::PassManagerImpl::run(llvm::Module&)
/home/su/software/tmp/polly/llvm/lib/IR/LegacyPassManager.cpp:1700:0
#24 0x000000000236d225 llvm::PrettyStackTraceString::~PrettyStackTraceString()
/home/su/software/tmp/polly/llvm/include/llvm/Support/PrettyStackTrace.h:52:0
#25 0x000000000236d225 EmitAssembly
/home/su/software/tmp/polly/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp:807:0
#26 0x000000000236d225 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:1199:0
#27 0x0000000002bcc7c7 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
#28 0x0000000002bcc7c7
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
/home/su/software/tmp/polly/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:292:0
#29 0x00000000030d5b00 clang::ParseAST(clang::Sema&, bool, bool)
/home/su/software/tmp/polly/llvm/tools/clang/lib/Parse/ParseAST.cpp:164:0
#30 0x0000000002bcbc5f clang::CodeGenAction::ExecuteAction()
/home/su/software/tmp/polly/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:1044:0
#31 0x000000000274d5de clang::FrontendAction::Execute()
/home/su/software/tmp/polly/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:904:0
#32 0x000000000271acd6
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/home/su/software/tmp/polly/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:992:0
#33 0x00000000027ddc1b
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/home/su/software/tmp/polly/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:255:0
#34 0x0000000000acfc78 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*)
/home/su/software/tmp/polly/llvm/tools/clang/tools/driver/cc1_main.cpp:221:0
#35 0x0000000000a43b40 ExecuteCC1Tool
/home/su/software/tmp/polly/llvm/tools/clang/tools/driver/driver.cpp:309:0
#36 0x0000000000a43b40 main
/home/su/software/tmp/polly/llvm/tools/clang/tools/driver/driver.cpp:389:0
#37 0x00007f9e4efa5830 __libc_start_main
/build/glibc-bfm8X4/glibc-2.23/csu/../csu/libc-start.c:325:0
#38 0x0000000000acc0a9 _start
(/home/su/software/tmp/polly/llvm_build/bin/clang-6.0+0xacc0a9)
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
-fno-escaping-block-tail-calls -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 -coverage-notes-file
/home/su/specres/good/20180304-clangpolly-m64-O3-build-180400/small.gcno
-resource-dir /home/su/software/tmp/polly/llvm_build/lib/clang/7.0.0
-internal-isystem /usr/local/include -internal-isystem
/home/su/software/tmp/polly/llvm_build/lib/clang/7.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O1
-fdebug-compilation-dir
/home/su/specres/good/20180304-clangpolly-m64-O3-build-180400 -ferror-limit 19
-fmessage-length 116 -fobjc-runtime=gcc -fdiagnostics-show-option
-fcolor-diagnostics -o small.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 'X86 DAG->DAG Instruction Selection' on function '@fn1'
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 7.0.0 (http://llvm.org/git/clang.git
26d4516ed3de4e70527ed6dd1b122ff03a3a7ba5) (http://llvm.org/git/llvm.git
022e5fa26f94e30bf52bcd4bfa4c72492ae2f23d)
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-e235ce.c
clang-6.0: note: diagnostic msg: /tmp/small-e235ce.sh
clang-6.0: note: diagnostic msg:
********************
$
------------------------------------------
int a, c, d, e, f, g, h, i;
static int b;
void fn1 ()
{
int k = 4, l = 0;
if (f)
goto L2;
l = 2;
L1:
d = -((k && a | l) | (i || e));
e = ~d || h ^ c;
L2:
k = g;
if (b)
goto L1;
while (1)
b++;
}
--
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/20180305/fecd6ed7/attachment-0001.html>
More information about the llvm-bugs
mailing list