<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 - Extreme compilation time degradation withof array of structs"
href="https://bugs.llvm.org/show_bug.cgi?id=37531">37531</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Extreme compilation time degradation withof array of structs
</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>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Keywords</th>
<td>regression, slow-compile
</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>v.reichelt@netcologne.de
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>The following code snippet takes more than 2 minutes to compile
with just "-O" enabled:
===========================================================
struct A {};
struct S
{
void foo();
S(int, const A& = A()) { foo(); }
~S();
};
struct X
{
S s1, s2, s3, s4, s5;
};
// helper macros for one, ten and fifty initializers for X
#define ONE { 0, 0, 0, 0, 0 },
#define TEN ONE ONE ONE ONE ONE ONE ONE ONE ONE ONE
#define FIFTY TEN TEN TEN TEN TEN
static const X x[] = {
FIFTY
FIFTY
FIFTY
FIFTY
FIFTY
FIFTY
};
===========================================================
There seems to be some exponential compile time growth,
because the time almost doubles for every 50 additional
initializers:
50: 1s
100: 5s
150: 17s
200: 41s
250: 81s
300: 145s
350: 230s
This is a very recent regression on the trunk (appeared within
the last week or so). Previous versions (including 6.0.0)
compile the code in less than 3 seconds.</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>