<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 --- - miscompile with -O2 (suspected incorrect loop trip count computation)"
href="http://llvm.org/bugs/show_bug.cgi?id=22795">22795</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>miscompile with -O2 (suspected incorrect loop trip count computation)
</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>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>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>kcc@google.com
</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 z.cc
#include <stdio.h>
#include <stdint.h>
#include <string.h>
int main(int argc, char **argv) {
const int n = 16;
int64_t bins[n] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
for (int ix = 0; ix < n; ++ix)
for (int jx = 0; jx < ix; ++jx)
bins[ix]++;
fprintf(stderr, "%ld\n", bins[10]);
}
% clang++ -O1 z.cc && ./a.out
10
% clang++ -O2 z.cc && ./a.out
4294967306
%
Something is messed up in computation of the loop trip count.
This is r231268 on x86_64 linux.</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>