<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 --- - do-loop miscompiled"
href="http://llvm.org/bugs/show_bug.cgi?id=19618">19618</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>do-loop miscompiled
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.4
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Other
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</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>kdevel@vogtner.de
</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>$ cat clang-loop-bug.c
#include <stdio.h>
#include <assert.h>
int main ()
{
unsigned u = 0xffffffff;
unsigned v1 = 0, v2 = 0;
do
v1 |= u;
while (u--);
printf ("v1 = <%u>\n", v1);
u = 0xffffffff;
do
v2 |= u;
while (--u);
printf ("v2 = <%u>\n", v2);
assert (v1 == v2);
return 0;
}
$ clang -O clang-loop-bug.c
$ ./a.out
v1 = <0>
v2 = <4294967295>
a.out: clang-loop-bug.c:17: int main(): Assertion `v1 == v2' failed.
Aborted</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>