[llvm-bugs] [Bug 32141] New: crash with "-O3 -m64" on x86_64-linux-gnu (Assertion `Idx >= 0 && "Invalid basic block argument!"' failed.)
via llvm-bugs
llvm-bugs at lists.llvm.org
Sun Mar 5 01:45:49 PST 2017
https://bugs.llvm.org/show_bug.cgi?id=32141
Bug ID: 32141
Summary: crash with "-O3 -m64" on x86_64-linux-gnu (Assertion
`Idx >= 0 && "Invalid basic block argument!"' failed.)
Product: clang
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: -New Bugs
Assignee: unassignedclangbugs at nondot.org
Reporter: chengniansun at gmail.com
CC: llvm-bugs at lists.llvm.org
$ clang-trunk -v
clang version 5.0.0 (trunk 296971)
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 -O3 small.c
clang-5.0:
/tmp/llvm-builder/llvm-source-trunk/include/llvm/IR/Instructions.h:2715:
llvm::Value* llvm::PHINode::getIncomingValueForBlock(const llvm::BasicBlock*)
const: Assertion `Idx >= 0 && "Invalid basic block argument!"' failed.
#0 0x0000000001ee872a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/local/clang-trunk/bin/clang-5.0+0x1ee872a)
#1 0x0000000001ee674e llvm::sys::RunSignalHandlers()
(/usr/local/clang-trunk/bin/clang-5.0+0x1ee674e)
#2 0x0000000001ee68b2 SignalHandler(int)
(/usr/local/clang-trunk/bin/clang-5.0+0x1ee68b2)
#3 0x00007f921e765330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#4 0x00007f921d556c37 gsignal
/build/eglibc-oGUzwX/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x00007f921d55a028 abort
/build/eglibc-oGUzwX/eglibc-2.19/stdlib/abort.c:91:0
#6 0x00007f921d54fbf6 __assert_fail_base
/build/eglibc-oGUzwX/eglibc-2.19/assert/assert.c:92:0
#7 0x00007f921d54fca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#8 0x0000000001002ebf (/usr/local/clang-trunk/bin/clang-5.0+0x1002ebf)
#9 0x0000000001f53d52 llvm::UnrollLoop(llvm::Loop*, unsigned int, unsigned int,
bool, bool, bool, bool, bool, unsigned int, unsigned int, llvm::LoopInfo*,
llvm::ScalarEvolution*, llvm::DominatorTree*, llvm::AssumptionCache*,
llvm::OptimizationRemarkEmitter*, bool)
(/usr/local/clang-trunk/bin/clang-5.0+0x1f53d52)
#10 0x0000000001dd6ce0 tryToUnrollLoop(llvm::Loop*, llvm::DominatorTree&,
llvm::LoopInfo*, llvm::ScalarEvolution*, llvm::TargetTransformInfo const&,
llvm::AssumptionCache&, llvm::OptimizationRemarkEmitter&, bool, int,
llvm::Optional<unsigned int>, llvm::Optional<unsigned int>,
llvm::Optional<bool>, llvm::Optional<bool>, llvm::Optional<bool>)
(/usr/local/clang-trunk/bin/clang-5.0+0x1dd6ce0)
#11 0x0000000001dd743a (anonymous
namespace)::LoopUnroll::runOnLoop(llvm::Loop*, llvm::LPPassManager&)
(/usr/local/clang-trunk/bin/clang-5.0+0x1dd743a)
#12 0x00000000016828f7 llvm::LPPassManager::runOnFunction(llvm::Function&)
(/usr/local/clang-trunk/bin/clang-5.0+0x16828f7)
#13 0x0000000001ad9863 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/usr/local/clang-trunk/bin/clang-5.0+0x1ad9863)
#14 0x0000000002835dbf (anonymous
namespace)::CGPassManager::runOnModule(llvm::Module&)
(/usr/local/clang-trunk/bin/clang-5.0+0x2835dbf)
#15 0x0000000001ada14f llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/usr/local/clang-trunk/bin/clang-5.0+0x1ada14f)
#16 0x000000000207398a (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+0x207398a)
#17 0x0000000002074c73 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+0x2074c73)
#18 0x00000000026d55fc
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/usr/local/clang-trunk/bin/clang-5.0+0x26d55fc)
#19 0x0000000002a9beb2 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/local/clang-trunk/bin/clang-5.0+0x2a9beb2)
#20 0x00000000026d3f9a clang::CodeGenAction::ExecuteAction()
(/usr/local/clang-trunk/bin/clang-5.0+0x26d3f9a)
#21 0x00000000023ba366 clang::FrontendAction::Execute()
(/usr/local/clang-trunk/bin/clang-5.0+0x23ba366)
#22 0x0000000002394a36
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/local/clang-trunk/bin/clang-5.0+0x2394a36)
#23 0x0000000002445cf4
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/local/clang-trunk/bin/clang-5.0+0x2445cf4)
#24 0x0000000000b235c8 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/local/clang-trunk/bin/clang-5.0+0xb235c8)
#25 0x0000000000ac4d7a main (/usr/local/clang-trunk/bin/clang-5.0+0xac4d7a)
#26 0x00007f921d541f45 __libc_start_main
/build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:321:0
#27 0x0000000000b1eeb9 _start (/usr/local/clang-trunk/bin/clang-5.0+0xb1eeb9)
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 -resource-dir
/usr/local/clang-trunk/lib/clang/5.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/lib/clang/5.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-9/res/20170304-clang-trunk-m32-Weverything-g-O3-build-192850/delta
-ferror-limit 19 -fmessage-length 270 -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-o /tmp/small-f68909.o -x c small.c
1. <eof> parser at end of file
2. Per-module optimization passes
3. Running pass 'CallGraph Pass Manager' on module 'small.c'.
4. Running pass 'Loop Pass Manager' on function '@main'
5. Running pass 'Unroll loops' on basic block '%for.cond1.preheader'
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 296971)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/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-e0bd1a.c
clang-5.0: note: diagnostic msg: /tmp/small-e0bd1a.sh
clang-5.0: note: diagnostic msg:
********************
$
$ cat small.c
int printf(const char*, ...);
int a[2];
int b, c, d, e;
int main() {
int f, i, j;
i = 0;
for (; i < 2; i++) {
f = 0;
for (; f < 8; f++) {
c = a[a[a[b]] ^ 5];
if (i)
printf("%d%d%d", f, d, f);
if (j)
printf("%d", e);
j |= 9;
}
i = 0;
for (; i < 1; i++)
;
}
}
$
--
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/20170305/f3439699/attachment.html>
More information about the llvm-bugs
mailing list