<html>
<head>
<base href="https://bugs.llvm.org/">
</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 - wrong code with "-mllvm -polly -mllvm -enable-newgvn -O3" in both 32-bit and 64-bit modes on x86_64-linux-gnu"
href="https://bugs.llvm.org/show_bug.cgi?id=34422">34422</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>wrong code with "-mllvm -polly -mllvm -enable-newgvn -O3" in both 32-bit and 64-bit modes on x86_64-linux-gnu
</td>
</tr>
<tr>
<th>Product</th>
<td>Polly
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</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>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Optimizer
</td>
</tr>
<tr>
<th>Assignee</th>
<td>polly-dev@googlegroups.com
</td>
</tr>
<tr>
<th>Reporter</th>
<td>chengniansun@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>I have to enable both polly and newgvn to trigger this bug. But I think the bug
is in polly.
$ clang-trunk -v
clang version 6.0.0 (trunk 312331)
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.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
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 -mllvm -polly -mllvm -enable-newgvn -O3 small.c ; ./a.out
l_2760=1
0
$ clang-trunk -mllvm -enable-newgvn -O3 small.c ; ./a.out
l_2760=1
1
$ clang-trunk -O3 small.c ; ./a.out
l_2760=1
1
$ cat small.c
int printf(const char *, ...);
static int a, b, c, h, m;
static char d = 3;
int e;
int f[2];
short g, k = 5, n;
int j;
int l;
int fn1() {
int o = 3;
for (;;) {
int p;
h = 10;
LABEL_T1T1d:
printf("l_2760=%llu\n", (long long)1);
if (!d)
continue;
for (;;) {
int i;
g = 2;
for (; g; g--) {
f[e] = f[b];
if (h) {
char q;
n = g;
g = n;
m = o;
q = d;
j = o - ~c ^ q;
o = k && l + j;
d = ~a;
if (!(m || k))
goto LABEL_T1T1d;
if (k < 1) {
printf("g_555=%lld\n", (long long)d);
break;
}
j = o = m;
d = q;
}
c = l;
}
return b;
}
}
}
int main() {
fn1();
printf("%d\n", n);
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>