[llvm-bugs] [Bug 32659] New: clang crashes on valid code at -Os and above (in 32-bit mode) running pass 'X86 DAG->DAG Instruction Selection': Assertion `N->getOpcode() != ISD::DELETED_NODE && "DELETED_NODE in CSEMap!"' failed
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Apr 13 21:53:11 PDT 2017
https://bugs.llvm.org/show_bug.cgi?id=32659
Bug ID: 32659
Summary: clang crashes on valid code at -Os and above (in
32-bit mode) running pass 'X86 DAG->DAG Instruction
Selection': Assertion `N->getOpcode() !=
ISD::DELETED_NODE && "DELETED_NODE in CSEMap!"' 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
It might be related to PR 32610.
$ clang -v
clang version 5.0.0 (trunk 300080)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/clang-trunk/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9.4
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.3.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.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.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.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.3.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.2.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$
$ clang -m32 -O1 small.c
$ clang-4.0.0 -m32 -Os small.c
$
$ clang -m32 -Os small.c
clang-5.0:
/tmp/llvm-builder/llvm-source-trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:746:
bool llvm::SelectionDAG::RemoveNodeFromCSEMaps(llvm::SDNode*): Assertion
`N->getOpcode() != ISD::DELETED_NODE && "DELETED_NODE in CSEMap!"' failed.
#0 0x000000000216c05a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/local/clang-trunk/bin/clang-5.0+0x216c05a)
#1 0x000000000216a17e llvm::sys::RunSignalHandlers()
(/usr/local/clang-trunk/bin/clang-5.0+0x216a17e)
#2 0x000000000216a2e0 SignalHandler(int)
(/usr/local/clang-trunk/bin/clang-5.0+0x216a2e0)
#3 0x00007f41b345b330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#4 0x00007f41b2244c37 gsignal
/build/eglibc-MjiXCM/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x00007f41b2248028 abort
/build/eglibc-MjiXCM/eglibc-2.19/stdlib/abort.c:91:0
#6 0x00007f41b223dbf6 __assert_fail_base
/build/eglibc-MjiXCM/eglibc-2.19/assert/assert.c:92:0
#7 0x00007f41b223dca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#8 0x00000000028ea61e llvm::SelectionDAG::RemoveNodeFromCSEMaps(llvm::SDNode*)
(/usr/local/clang-trunk/bin/clang-5.0+0x28ea61e)
#9 0x00000000028ea6b2
llvm::SelectionDAG::RemoveDeadNodes(llvm::SmallVectorImpl<llvm::SDNode*>&)
(/usr/local/clang-trunk/bin/clang-5.0+0x28ea6b2)
#10 0x00000000028f8934 llvm::SelectionDAGISel::UpdateChains(llvm::SDNode*,
llvm::SDValue, llvm::SmallVectorImpl<llvm::SDNode*>&, bool)
(/usr/local/clang-trunk/bin/clang-5.0+0x28f8934)
#11 0x0000000002902bdc llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*,
unsigned char const*, unsigned int)
(/usr/local/clang-trunk/bin/clang-5.0+0x2902bdc)
#12 0x000000000160c2df (anonymous
namespace)::X86DAGToDAGISel::Select(llvm::SDNode*)
(/usr/local/clang-trunk/bin/clang-5.0+0x160c2df)
#13 0x00000000028f75c2 llvm::SelectionDAGISel::DoInstructionSelection()
(/usr/local/clang-trunk/bin/clang-5.0+0x28f75c2)
#14 0x00000000028fbb8f llvm::SelectionDAGISel::CodeGenAndEmitDAG()
(/usr/local/clang-trunk/bin/clang-5.0+0x28fbb8f)
#15 0x00000000029041ea
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&)
(/usr/local/clang-trunk/bin/clang-5.0+0x29041ea)
#16 0x0000000002906429
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) [clone
.part.979] (/usr/local/clang-trunk/bin/clang-5.0+0x2906429)
#17 0x00000000016100f4 (anonymous
namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(/usr/local/clang-trunk/bin/clang-5.0+0x16100f4)
#18 0x0000000001a270a7
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/usr/local/clang-trunk/bin/clang-5.0+0x1a270a7)
#19 0x0000000001d143d3 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/usr/local/clang-trunk/bin/clang-5.0+0x1d143d3)
#20 0x0000000001d1447c llvm::FPPassManager::runOnModule(llvm::Module&)
(/usr/local/clang-trunk/bin/clang-5.0+0x1d1447c)
#21 0x0000000001d14cba llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/usr/local/clang-trunk/bin/clang-5.0+0x1d14cba)
#22 0x0000000002301e78 (anonymous
namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(/usr/local/clang-trunk/bin/clang-5.0+0x2301e78)
#23 0x0000000002303271 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> >)
(/usr/local/clang-trunk/bin/clang-5.0+0x2303271)
#24 0x00000000029c7987
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/usr/local/clang-trunk/bin/clang-5.0+0x29c7987)
#25 0x0000000002dc67fc clang::ParseAST(clang::Sema&, bool, bool)
(/usr/local/clang-trunk/bin/clang-5.0+0x2dc67fc)
#26 0x00000000029c6d3a clang::CodeGenAction::ExecuteAction()
(/usr/local/clang-trunk/bin/clang-5.0+0x29c6d3a)
#27 0x0000000002684a2e clang::FrontendAction::Execute()
(/usr/local/clang-trunk/bin/clang-5.0+0x2684a2e)
#28 0x000000000265b00e
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/local/clang-trunk/bin/clang-5.0+0x265b00e)
#29 0x00000000027199e2
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/local/clang-trunk/bin/clang-5.0+0x27199e2)
#30 0x0000000000c72688 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/local/clang-trunk/bin/clang-5.0+0xc72688)
#31 0x0000000000c12a15 main (/usr/local/clang-trunk/bin/clang-5.0+0xc12a15)
#32 0x00007f41b222ff45 __libc_start_main
/build/eglibc-MjiXCM/eglibc-2.19/csu/libc-start.c:321:0
#33 0x0000000000c6e2a9 _start (/usr/local/clang-trunk/bin/clang-5.0+0xc6e2a9)
Stack dump:
0. Program arguments: /usr/local/clang-trunk/bin/clang-5.0 -cc1 -triple
i386-unknown-linux-gnu -emit-obj -disable-free -main-file-name small.c
-mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose
-mconstructor-aliases -fuse-init-array -target-cpu pentium4
-momit-leaf-frame-pointer -dwarf-column-info -debugger-tuning=gdb -resource-dir
/usr/local/clang-trunk/lib/clang/5.0.0 -internal-isystem /usr/local/include
-internal-isystem /usr/local/clang-trunk/lib/clang/5.0.0/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include -Os
-fdebug-compilation-dir /data2 -ferror-limit 19 -fmessage-length 160
-fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics
-vectorize-loops -vectorize-slp -o /tmp/small-514682.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 '@fn2'
clang-5.0: error: unable to execute command: Aborted (core dumped)
clang-5.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 5.0.0 (trunk 300080)
Target: i386-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/clang-trunk/bin
clang-5.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-5.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-5.0: note: diagnostic msg: /tmp/small-ca2e04.c
clang-5.0: note: diagnostic msg: /tmp/small-ca2e04.sh
clang-5.0: note: diagnostic msg:
********************
$
---------------------------------------------------
int printf (const char *, ...);
int a, b, c, *d = &a, g, i, **k = &d, ***j = &k;
int volatile h;
long long e, f;
int fn1 (int p)
{
return p;
}
void fn2 ()
{
printf ("0");
a ^= h > (b = (c > ***j) < i);
long long *n = &f;
e &= fn1 (*d);
g--;
++*n;
}
int main ()
{
fn2 ();
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/20170414/309f16e4/attachment-0001.html>
More information about the llvm-bugs
mailing list