<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 at -O1, -O2, -O3 (but -Os) on x86_64-linux-gnu"
href="https://bugs.llvm.org/show_bug.cgi?id=52379">52379</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>wrong code at -O1, -O2, -O3 (but -Os) on x86_64-linux-gnu
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</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>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>zhendong.su@inf.ethz.ch
</td>
</tr>
<tr>
<th>CC</th>
<td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>This appears to be a recent regression.
[508] % clangtk -v
clang version 14.0.0 (<a href="https://github.com/llvm/llvm-project.git">https://github.com/llvm/llvm-project.git</a>
8cabd8f0d26c3cff03faec9b1cea974f08618d6d)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /local/suz-local/opfuzz/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
[509] %
[509] % clangtk -O0 small.c; ./a.out
[510] %
[510] % clangtk -O1 small.c
[511] % ./a.out
Segmentation fault
[512] %
[512] % cat small.c
int printf(const char *, ...);
int a = 354757809, b[2], c, d = 147639773, e, n = 2000;
short f = -25324;
long g;
int main() {
int h = a, k = ~d, m = 0;
a = ~h;
if (a > 3)
goto L2;
a = h;
--d;
e = d;
L1:
d = ~(~48988294629 & ~d * (~48988294629 | ~e));
a = (h | d) ^ ~(e | f) ^ (a - 48988294629);
unsigned l;
if (k)
if (a > 1523073808)
c++;
if (a <= 1523073808)
l = d;
if (a >= 1523073808) {
m = a;
while (a > 1523073808)
;
}
a = m;
L2:
a = l;
if (m)
g = ~a;
if (g > 4073172680703UL) {
printf("%d\n", b[n]);
goto L1;
}
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>