<html>
<head>
<base href="http://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 --- - Wrong constant folding"
href="http://llvm.org/bugs/show_bug.cgi?id=16108">16108</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Wrong constant folding
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</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>Backend: X86
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>ishiura-compiler@ml.kwansei.ac.jp
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>LLVM (git) + clang (3.4) for i386 miscompiles the following code
where LLONG_MAX == 9223372036854775807.
$ cat error.c
int main (void)
{
int x = 1;
long long t = 1LL;
t = 1LL << (( x << 8 ) + ( -224 ));
if ( t != 4294967296LL ){ __builtin_abort(); }
return 0;
}
$ clang error.c
$ ./a.out
Aborted (core dumped)
There was no problem with an x86_64 target.
$ clang -v
clang version 3.4 (<a href="http://llvm.org/git/clang.git">http://llvm.org/git/clang.git</a>
800ff45b49e306a5706f249d3289281dc224dcb3)
(<a href="http://llvm.org/git/llvm.git">http://llvm.org/git/llvm.git</a>
f8cd1ee516c845285fd6a7ee27abb5339c5f3fba)
Target: i386-pc-linux-gnu
Thread model: posix</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>