<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 -O3 on x86_64-linux-gnu in 64-bit mode (not in 32-bit mode)"
href="https://bugs.llvm.org/show_bug.cgi?id=39499">39499</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>wrong code at -O3 on x86_64-linux-gnu in 64-bit mode (not in 32-bit mode)
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</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>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>su@cs.ucdavis.edu
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>Tested with trunk revision 345488.
$ clangpolly -v
clang version 8.0.0 (<a href="http://llvm.org/git/clang.git">http://llvm.org/git/clang.git</a>
8029b38886dd239769e3501dac21438e16886ce8) (llvm/trunk 345488)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/su/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.4
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.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.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
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.2.0
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
$
$ clangpolly -m64 -O2 small.c
$ ./a.out
$
$ clangpolly -m32 -O3 small.c
$ ./a.out
$
$ clangpolly -m64 -O3 small.c
$ ./a.out
Floating point exception (core dumped)
$
-----------------------------------------
int printf (const char *, ...);
long a, b, i;
int c, f, g = 1, j, k, l, m = 6, n = 3;
short d = 4;
char e, h;
int main ()
{
while (1)
{
L:
for (; j < 10; j++)
{
for (h = 2; h >= 0; h--)
while (1)
{
if (l)
f = 2;
int q = 9L / g / ~e | (n ^ c) | f, t = 9 & -(~e / q & g);
char aa = ~(~i * -c & ~f) / n ^ t ^ 9;
long ab;
if (d)
break;
if (e)
ab = i = ~(e & 9L * (g * aa) & ~c & f) & n;
e = ~(n / -i * e & ab) | -(-aa | g);
i = ~i / ~e / q ^ ~t;
if (g)
{
printf ("%d\n", e);
goto L;
}
while (h > b)
;
g = c = e;
break;
}
for (n = 0; n < 10; n++)
if (a && h < c)
break;
if (k)
{
printf ("%d\n", k);
continue;
}
f = h % (unsigned) 9;
}
if (f > 3)
m = 0;
int s = 46744073709551608 % m;
if (s)
break;
}
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>