[llvm-bugs] [Bug 32420] New: clang crashes at -O1 on x86_64-linux-gnu running pass 'X86 DAG->DAG Instruction Selection': Assertion `Num < NumOperands && "Invalid child # of SDNode!"' failed
via llvm-bugs
llvm-bugs at lists.llvm.org
Sat Mar 25 06:33:12 PDT 2017
https://bugs.llvm.org/show_bug.cgi?id=32420
Bug ID: 32420
Summary: clang crashes at -O1 on x86_64-linux-gnu running pass
'X86 DAG->DAG Instruction Selection': Assertion `Num <
NumOperands && "Invalid child # of SDNode!"' 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
This is a recent regression and possibly related to PR30517 (which does not
reproduce anymore).
$ clang -v
clang version 5.0.0 (trunk 298721)
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 -O0 -c small.c
$
$ clang -O1 -c small.c
clang-5.0:
/tmp/llvm-builder/llvm-source-trunk/include/llvm/CodeGen/SelectionDAGNodes.h:746:
const llvm::SDValue& llvm::SDNode::getOperand(unsigned int) const: Assertion
`Num < NumOperands && "Invalid child # of SDNode!"' failed.
#0 0x0000000002136c4a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/local/clang-trunk/bin/clang-5.0+0x2136c4a)
#1 0x0000000002134d6e llvm::sys::RunSignalHandlers()
(/usr/local/clang-trunk/bin/clang-5.0+0x2134d6e)
#2 0x0000000002134ed0 SignalHandler(int)
(/usr/local/clang-trunk/bin/clang-5.0+0x2134ed0)
#3 0x00007f2bb2249330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#4 0x00007f2bb1035c37 gsignal
/build/eglibc-oGUzwX/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x00007f2bb1039028 abort
/build/eglibc-oGUzwX/eglibc-2.19/stdlib/abort.c:91:0
#6 0x00007f2bb102ebf6 __assert_fail_base
/build/eglibc-oGUzwX/eglibc-2.19/assert/assert.c:92:0
#7 0x00007f2bb102eca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#8 0x00000000027b9c73 (/usr/local/clang-trunk/bin/clang-5.0+0x27b9c73)
#9 0x00000000028176bb (anonymous
namespace)::DAGCombiner::combine(llvm::SDNode*)
(/usr/local/clang-trunk/bin/clang-5.0+0x28176bb)
#10 0x0000000002818416 llvm::SelectionDAG::Combine(llvm::CombineLevel,
llvm::AAResults&, llvm::CodeGenOpt::Level)
(/usr/local/clang-trunk/bin/clang-5.0+0x2818416)
#11 0x00000000028d292a llvm::SelectionDAGISel::CodeGenAndEmitDAG()
(/usr/local/clang-trunk/bin/clang-5.0+0x28d292a)
#12 0x00000000028dae9b
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&)
(/usr/local/clang-trunk/bin/clang-5.0+0x28dae9b)
#13 0x00000000028dd1ba
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) [clone
.part.969] (/usr/local/clang-trunk/bin/clang-5.0+0x28dd1ba)
#14 0x00000000015e2e74 (anonymous
namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(/usr/local/clang-trunk/bin/clang-5.0+0x15e2e74)
#15 0x00000000019f7b67
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/usr/local/clang-trunk/bin/clang-5.0+0x19f7b67)
#16 0x0000000001ce3483 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/usr/local/clang-trunk/bin/clang-5.0+0x1ce3483)
#17 0x0000000001ce352c llvm::FPPassManager::runOnModule(llvm::Module&)
(/usr/local/clang-trunk/bin/clang-5.0+0x1ce352c)
#18 0x0000000001ce3d7a llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/usr/local/clang-trunk/bin/clang-5.0+0x1ce3d7a)
#19 0x00000000022dc498 (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+0x22dc498)
#20 0x00000000022dd8ab 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+0x22dd8ab)
#21 0x000000000299e2f7
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/usr/local/clang-trunk/bin/clang-5.0+0x299e2f7)
#22 0x0000000002d7982c clang::ParseAST(clang::Sema&, bool, bool)
(/usr/local/clang-trunk/bin/clang-5.0+0x2d7982c)
#23 0x000000000299d6aa clang::CodeGenAction::ExecuteAction()
(/usr/local/clang-trunk/bin/clang-5.0+0x299d6aa)
#24 0x000000000265c91e clang::FrontendAction::Execute()
(/usr/local/clang-trunk/bin/clang-5.0+0x265c91e)
#25 0x0000000002632ece
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/local/clang-trunk/bin/clang-5.0+0x2632ece)
#26 0x00000000026f1582
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/local/clang-trunk/bin/clang-5.0+0x26f1582)
#27 0x0000000000c5bbd8 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/local/clang-trunk/bin/clang-5.0+0xc5bbd8)
#28 0x0000000000bfc975 main (/usr/local/clang-trunk/bin/clang-5.0+0xbfc975)
#29 0x00007f2bb1020f45 __libc_start_main
/build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:321:0
#30 0x0000000000c57879 _start (/usr/local/clang-trunk/bin/clang-5.0+0xc57879)
Stack dump:
0. Program arguments: /usr/local/clang-trunk/bin/clang-5.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
-momit-leaf-frame-pointer -dwarf-column-info -debugger-tuning=gdb
-coverage-notes-file /data2/small.gcno -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 /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O1
-fdebug-compilation-dir /data2 -ferror-limit 19 -fmessage-length 160
-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-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 298721)
Target: x86_64-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-6d75e8.c
clang-5.0: note: diagnostic msg: /tmp/small-6d75e8.sh
clang-5.0: note: diagnostic msg:
********************
$
--------------------------------------
struct S
{
int x:4;
int:12;
} a;
int b;
char c, d;
volatile char e;
void fn1 ()
{
struct S f = { 1 };
f.x = !c;
char g = b / f.x, h = a.x | e;
int i = h & a.x;
b = i;
d = a.x & f.x;
e = g;
}
--
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/20170325/64a8415e/attachment.html>
More information about the llvm-bugs
mailing list