[llvm-bugs] [Bug 30517] New: crash at -Os and above in both 32-bit and 64-bit modes on x86_64-linux-gnu (Assertion `Num < NumOperands && "Invalid child # of SDNode!"' failed.)
via llvm-bugs
llvm-bugs at lists.llvm.org
Sun Sep 25 11:06:33 PDT 2016
https://llvm.org/bugs/show_bug.cgi?id=30517
Bug ID: 30517
Summary: crash at -Os and above in both 32-bit and 64-bit modes
on x86_64-linux-gnu (Assertion `Num < NumOperands &&
"Invalid child # of SDNode!"' failed.)
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
Assignee: unassignedclangbugs at nondot.org
Reporter: chengniansun at gmail.com
CC: llvm-bugs at lists.llvm.org
Classification: Unclassified
$ clang-trunk -v
clang version 4.0.0 (trunk 282354)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
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.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.2
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.3.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$
$ clang-trunk -g -O3 small.c
clang-4.0:
/tmp/llvm-builder/llvm-source-trunk/include/llvm/CodeGen/SelectionDAGNodes.h:728:
const llvm::SDValue& llvm::SDNode::getOperand(unsigned int) const: Assertion
`Num < NumOperands && "Invalid child # of SDNode!"' failed.
#0 0x0000000001ca1b55 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/local/clang-trunk/bin/clang-4.0+0x1ca1b55)
#1 0x0000000001c9fafe llvm::sys::RunSignalHandlers()
(/usr/local/clang-trunk/bin/clang-4.0+0x1c9fafe)
#2 0x0000000001c9fc62 SignalHandler(int)
(/usr/local/clang-trunk/bin/clang-4.0+0x1c9fc62)
#3 0x00007f3670054330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#4 0x00007f366ee45c37 gsignal
/build/eglibc-oGUzwX/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x00007f366ee49028 abort
/build/eglibc-oGUzwX/eglibc-2.19/stdlib/abort.c:91:0
#6 0x00007f366ee3ebf6 __assert_fail_base
/build/eglibc-oGUzwX/eglibc-2.19/assert/assert.c:92:0
#7 0x00007f366ee3eca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#8 0x0000000002237a23 (/usr/local/clang-trunk/bin/clang-4.0+0x2237a23)
#9 0x000000000226cfa6 (anonymous
namespace)::DAGCombiner::ExtendSetCCUses(llvm::SmallVectorImpl<llvm::SDNode*>
const&, llvm::SDValue, llvm::SDValue, llvm::SDLoc const&, llvm::ISD::NodeType)
[clone .isra.586] (/usr/local/clang-trunk/bin/clang-4.0+0x226cfa6)
#10 0x000000000227267e (anonymous
namespace)::DAGCombiner::visitSIGN_EXTEND(llvm::SDNode*)
(/usr/local/clang-trunk/bin/clang-4.0+0x227267e)
#11 0x000000000228f24d (anonymous namespace)::DAGCombiner::visit(llvm::SDNode*)
(/usr/local/clang-trunk/bin/clang-4.0+0x228f24d)
#12 0x000000000229170c (anonymous
namespace)::DAGCombiner::combine(llvm::SDNode*)
(/usr/local/clang-trunk/bin/clang-4.0+0x229170c)
#13 0x0000000002293023 llvm::SelectionDAG::Combine(llvm::CombineLevel,
llvm::AAResults&, llvm::CodeGenOpt::Level)
(/usr/local/clang-trunk/bin/clang-4.0+0x2293023)
#14 0x0000000002348748 llvm::SelectionDAGISel::CodeGenAndEmitDAG()
(/usr/local/clang-trunk/bin/clang-4.0+0x2348748)
#15 0x0000000002350b2d
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&)
(/usr/local/clang-trunk/bin/clang-4.0+0x2350b2d)
#16 0x000000000235277c
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) [clone
.part.879] (/usr/local/clang-trunk/bin/clang-4.0+0x235277c)
#17 0x00000000012f0824 (anonymous
namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(/usr/local/clang-trunk/bin/clang-4.0+0x12f0824)
#18 0x000000000167dd93
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/usr/local/clang-trunk/bin/clang-4.0+0x167dd93)
#19 0x000000000191d3a3 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/usr/local/clang-trunk/bin/clang-4.0+0x191d3a3)
#20 0x000000000191d44c llvm::FPPassManager::runOnModule(llvm::Module&)
(/usr/local/clang-trunk/bin/clang-4.0+0x191d44c)
#21 0x000000000191da6f llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/usr/local/clang-trunk/bin/clang-4.0+0x191da6f)
#22 0x0000000001e00d80 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
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-4.0+0x1e00d80)
#23 0x0000000002401838
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/usr/local/clang-trunk/bin/clang-4.0+0x2401838)
#24 0x00000000027d9322 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/local/clang-trunk/bin/clang-4.0+0x27d9322)
#25 0x0000000002401c2e clang::CodeGenAction::ExecuteAction()
(/usr/local/clang-trunk/bin/clang-4.0+0x2401c2e)
#26 0x0000000002114c86 clang::FrontendAction::Execute()
(/usr/local/clang-trunk/bin/clang-4.0+0x2114c86)
#27 0x00000000020ef37e
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/local/clang-trunk/bin/clang-4.0+0x20ef37e)
#28 0x000000000219ca76
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/local/clang-trunk/bin/clang-4.0+0x219ca76)
#29 0x0000000000a8d528 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/local/clang-trunk/bin/clang-4.0+0xa8d528)
#30 0x0000000000a36141 main (/usr/local/clang-trunk/bin/clang-4.0+0xa36141)
#31 0x00007f366ee30f45 __libc_start_main
/build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:321:0
#32 0x0000000000a8954e _start (/usr/local/clang-trunk/bin/clang-4.0+0xa8954e)
Stack dump:
0. Program arguments: /usr/local/clang-trunk/bin/clang-4.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 -debug-info-kind=limited
-dwarf-version=4 -debugger-tuning=gdb -resource-dir
/usr/local/clang-trunk/bin/../lib/clang/4.0.0 -c-isystem . -c-isystem
/usr/local/include/csmith-2.2.0/ -c-isystem /usr/local/include/csmith-2.2.0/
-internal-isystem /usr/local/include -internal-isystem
/usr/local/clang-trunk/bin/../lib/clang/4.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/cnsun/ramdisk/hermes/run-3/res/20160924-clang-trunk-m32-g-O3-build-103456/delta
-ferror-limit 19 -fmessage-length 118 -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-o /tmp/small-ba15f8.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 '@main'
clang-4.0: error: unable to execute command: Aborted (core dumped)
clang-4.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 4.0.0 (trunk 282354)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang-4.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-4.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-4.0: note: diagnostic msg: /tmp/small-2410ee.c
clang-4.0: note: diagnostic msg: /tmp/small-2410ee.sh
clang-4.0: note: diagnostic msg:
********************
$
$ cat small.c
short a, c, d;
int b, f;
char i;
char fn1(int p1) { return p1; }
int main() {
if (d)
for (; f;) {
for (;;) {
int o = i;
if (c && fn1(d) >= d)
for (;;)
;
if (a)
c = d < 0 ? 0 : d << b;
if (b)
f = 1;
short p = d;
a = p < 0 || p > b ? p : b;
for (; a;)
if (o) {
__builtin_printf("%d", i);
goto L;
}
}
L:
while (i)
;
}
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/20160925/3b01148a/attachment.html>
More information about the llvm-bugs
mailing list