<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 --- - extremely slow compilation at -O3 than -O2 (~400 seconds vs. ~0.1 seconds)"
href="http://llvm.org/bugs/show_bug.cgi?id=16474">16474</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>extremely slow compilation at -O3 than -O2 (~400 seconds vs. ~0.1 seconds)
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</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>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>LLVM Codegen
</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>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>The following code takes much longer to compile at -O3 than at -O2, using the
current clang-trunk and clang 3.3 on x86_64-linux. For additional reference,
gcc 4.8.1 at -O3 takes ~0.14 seconds, and icc 13.1.1 at -O3 takes ~3.4 seconds.
It appears to be a regression from clang 3.2 (which takes about 9 seconds at
-O3).
% clang-trunk -v
clang version 3.4 (trunk 185061)
Target: x86_64-pc-linux-gnu
Thread model: posix
% time clang-trunk -O3 reduced.c
real 6m35.619s
user 4m56.983s
sys 0m0.080s
%
% time clang-trunk -O2 reduced.c
real 0m0.102s
user 0m0.028s
sys 0m0.008s
%
% time clang-3.2 -O3 reduced.c
real 0m9.003s
user 0m7.764s
sys 0m0.024s
%
% time gcc-4.8 -O3 reduced.c
real 0m0.138s
user 0m0.036s
sys 0m0.020s
%
% time icc -O3 reduced.c
real 0m3.374s
user 0m0.232s
sys 0m2.028s
-----------------------------------------------------
int a = 1, b, c, *d = &c, e, f, g, k, l, x;
static int * volatile *h = &d;
static int * volatile **j = &h;
void foo (int p)
{
d = &p;
}
void bar ()
{
int i;
foo (0);
for (i = 0; i < 27; ++i)
for (f = 0; f < 3; f++)
for (g = 0; g < 3; g++)
{
for (b = 0; b < 3; b++)
if (e)
break;
foo (0);
}
}
static void baz ()
{
for (; a >= 0; a--)
for (k = 3; k > 0; k--)
for (l = 0; l < 6; l++)
{
bar ();
**j = &x;
}
}
int main ()
{
baz ();
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>