<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - crash at -O1 to -O3 in 64-bit mode on x86_64-linux-gnu (Assertion `DL.getTypeAllocSize(SliceTy) >= P.size()' failed)"
href="https://llvm.org/bugs/show_bug.cgi?id=26972">26972</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>crash at -O1 to -O3 in 64-bit mode on x86_64-linux-gnu (Assertion `DL.getTypeAllocSize(SliceTy) >= P.size()' failed)
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>chengniansun@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>The following code crashes the trunk at -O1 and above in 64-bit mode on
x86_64-linux-gnu.
$: clang-trunk -v
clang version 3.9.0 (trunk 263641)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
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.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 -c -m64 small.c -O3
clang-3.9:
/tmp/llvm-builder/llvm-source-trunk/lib/Transforms/Scalar/SROA.cpp:3818:
llvm::AllocaInst* llvm::SROA::rewritePartition(llvm::AllocaInst&,
llvm::sroa::AllocaSlices&, llvm::sroa::Partition&): Assertion
`DL.getTypeAllocSize(SliceTy) >= P.size()' failed.
0 clang-3.9 0x0000000001abe055
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1 clang-3.9 0x0000000001abbe06 llvm::sys::RunSignalHandlers() + 54
2 clang-3.9 0x0000000001abc031
3 libpthread.so.0 0x00007f1dd8e9a340
4 libc.so.6 0x00007f1dd80b8cc9 gsignal + 57
5 libc.so.6 0x00007f1dd80bc0d8 abort + 328
6 libc.so.6 0x00007f1dd80b1b86
7 libc.so.6 0x00007f1dd80b1c32
8 clang-3.9 0x0000000001a1de9c
9 clang-3.9 0x0000000001a1e421
10 clang-3.9 0x0000000001a1f623
llvm::SROA::runOnAlloca(llvm::AllocaInst&) + 2659
11 clang-3.9 0x0000000001a20967 llvm::SROA::runImpl(llvm::Function&,
llvm::DominatorTree&, llvm::AssumptionCache&) + 391
12 clang-3.9 0x0000000001a21265
13 clang-3.9 0x0000000001777ab3
llvm::FPPassManager::runOnFunction(llvm::Function&) + 643
14 clang-3.9 0x0000000001777ba7
llvm::legacy::FunctionPassManagerImpl::run(llvm::Function&) + 135
15 clang-3.9 0x0000000001777c84
llvm::legacy::FunctionPassManager::run(llvm::Function&) + 36
16 clang-3.9 0x0000000001be8025
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&,
llvm::DataLayout const&, llvm::Module*, clang::BackendAction,
llvm::raw_pwrite_stream*) + 3013
17 clang-3.9 0x00000000021726ec
18 clang-3.9 0x000000000248b1eb clang::ParseAST(clang::Sema&, bool, bool)
+ 571
19 clang-3.9 0x000000000217287e clang::CodeGenAction::ExecuteAction() +
78
20 clang-3.9 0x0000000001ec5696 clang::FrontendAction::Execute() + 534
21 clang-3.9 0x0000000001ea1f5e
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 318
22 clang-3.9 0x0000000001f4948c
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2300
23 clang-3.9 0x00000000009e2a98 cc1_main(llvm::ArrayRef<char const*>,
char const*, void*) + 2344
24 clang-3.9 0x000000000099e895 main + 6213
25 libc.so.6 0x00007f1dd80a3ec5 __libc_start_main + 245
26 clang-3.9 0x00000000009dea44
Stack dump:
0. Program arguments: /usr/local/clang-trunk/bin/clang-3.9 -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-file /home/cnsun/temp/clang-array/small.c -resource-dir
/usr/local/clang-trunk/bin/../lib/clang/3.9.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/3.9.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/temp/clang-array -ferror-limit 19 -fmessage-length 126
-fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics
-vectorize-loops -vectorize-slp -o small.o -x c small.c
1. <eof> parser at end of file
2. Per-function optimization
3. Running pass 'SROA' on function '@fn1'
clang-3.9: error: unable to execute command: Aborted (core dumped)
clang-3.9: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.9.0 (trunk 263641)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang-3.9: note: diagnostic msg: PLEASE submit a bug report to
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and
associated run script.
clang-3.9: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.9: note: diagnostic msg: /home/cnsun/ramdisk/tmp/small-fa0857.c
clang-3.9: note: diagnostic msg: /home/cnsun/ramdisk/tmp/small-fa0857.sh
clang-3.9: note: diagnostic msg:
********************
$: clang-trunk -c -m64 small.c -O0
$:
$: cat small.c
void fn1() { int a[1073741824 + 1]; }
$:</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>