<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 on x86_64-linux-gnu at -O2 and above in both 32-bit and 64-bit modes (Assertion `L->isRecursivelyLCSSAForm(*DT) && "Indvars did not preserve LCSSA!"' failed)"
href="https://llvm.org/bugs/show_bug.cgi?id=26682">26682</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>crash on x86_64-linux-gnu at -O2 and above in both 32-bit and 64-bit modes (Assertion `L->isRecursivelyLCSSAForm(*DT) && "Indvars did not preserve LCSSA!"' 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 on x86_64-linux-gnu at -O2 and above in
both 32-bit and 64-bit modes. 3.7.1 is okay with the code.
$: clang-trunk -v
clang version 3.9.0 (trunk 261420)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/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.3
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.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.3.0
Found candidate GCC installation:
/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.3
Found candidate GCC installation:
/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.7.4
Found candidate GCC installation:
/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.2
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-trunk -O3 small.c
clang-3.9: /tmp/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:2226: virtual
bool {anonymous}::IndVarSimplify::runOnLoop(llvm::Loop*, llvm::LPPassManager&):
Assertion `L->isRecursivelyLCSSAForm(*DT) && "Indvars did not preserve LCSSA!"'
failed.
0 clang-3.9 0x0000000002d6dd22
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 44
1 clang-3.9 0x0000000002d6e037
2 clang-3.9 0x0000000002d6c74f llvm::sys::RunSignalHandlers() + 118
3 clang-3.9 0x0000000002d6d849
4 libpthread.so.0 0x00007f1a12878340
5 libc.so.6 0x00007f1a11a96cc9 gsignal + 57
6 libc.so.6 0x00007f1a11a9a0d8 abort + 328
7 libc.so.6 0x00007f1a11a8fb86
8 libc.so.6 0x00007f1a11a8fc32
9 clang-3.9 0x0000000002bb22ba
10 clang-3.9 0x000000000392d7c7
llvm::LPPassManager::runOnFunction(llvm::Function&) + 969
11 clang-3.9 0x00000000028b322e
llvm::FPPassManager::runOnFunction(llvm::Function&) + 290
12 clang-3.9 0x000000000390631d
13 clang-3.9 0x000000000390734b
14 clang-3.9 0x0000000003907650
15 clang-3.9 0x00000000028b375c
16 clang-3.9 0x00000000028b3eac
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 256
17 clang-3.9 0x00000000028b40ed
llvm::legacy::PassManager::run(llvm::Module&) + 39
18 clang-3.9 0x0000000002f629b2
19 clang-3.9 0x0000000002f62af9
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&,
llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::raw_pwrite_stream*)
+ 127
20 clang-3.9 0x00000000037af42b
21 clang-3.9 0x0000000003ffb60a clang::ParseAST(clang::Sema&, bool, bool)
+ 849
22 clang-3.9 0x0000000003402bde clang::ASTFrontendAction::ExecuteAction()
+ 322
23 clang-3.9 0x00000000037ae674 clang::CodeGenAction::ExecuteAction() +
1894
24 clang-3.9 0x00000000034026a3 clang::FrontendAction::Execute() + 135
25 clang-3.9 0x00000000033ba8fc
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 988
26 clang-3.9 0x00000000034f7916
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1062
27 clang-3.9 0x0000000001617de9 cc1_main(llvm::ArrayRef<char const*>,
char const*, void*) + 1052
28 clang-3.9 0x000000000160e5ee
29 clang-3.9 0x000000000160ef9e main + 2046
30 libc.so.6 0x00007f1a11a81ec5 __libc_start_main + 245
31 clang-3.9 0x000000000160bfd9
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 -resource-dir
/usr/local/clang-trunk/bin/../lib/clang/3.9.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
/data2/c-hunter-results/C/instrument-bugs/REDUCED/20160220-clang-trunk-m32-g-O3-build-110437/delta
-ferror-limit 19 -fmessage-length 128 -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-o /tmp/small-2e6bd1.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 '@fn2'
5. Running pass 'Induction Variable Simplification' on basic block
'%for.cond1thread-pre-split'
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 261420)
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: /tmp/small-e665c4.c
clang-3.9: note: diagnostic msg: /tmp/small-e665c4.sh
clang-3.9: note: diagnostic msg:
********************
$:
$:
$: cat small.c
char a, b, h, i, k, l, n;
int c, d, e, f, m;
int g[5];
short j;
char fn1(p1, p2) { return p2 == 0 ? p1 : p1 / p2; }
void fn2() {
for (;;) {
for (; h; h++)
if (c)
for (; m;)
;
char o;
for (;;) {
for (;; f++)
if (d)
break;
break;
}
o = 0;
for (; o <= 5; o++) {
l = fn1(i--, o);
n = l % a;
k = b << n;
j = k >> o != j;
if (m)
break;
}
e = 0;
for (; e < 5; e++)
g[e] = 1;
}
}
int main() { return 0; }</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>