<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 --- - Stack overflow in generated code."
href="http://llvm.org/bugs/show_bug.cgi?id=18420">18420</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Stack overflow in generated code.
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.3
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>FreeBSD
</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>slw@zxy.spb.ru
</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>FreeBSD 10-RC4
Translatig /usr/src/cddl/usr.sbin/zdb generate assmbler code for main() as
(gdb) x/40i main
0x404e30 <main>: push %rbp
0x404e31 <main+1>: mov %rsp,%rbp
0x404e34 <main+4>: push %r15
0x404e36 <main+6>: push %r14
0x404e38 <main+8>: push %r13
0x404e3a <main+10>: push %r12
0x404e3c <main+12>: push %rbx
0x404e3d <main+13>: sub $0x2d07a8,%rsp
i.e. allocating more then 3MB stack.
Same code translated by gcc:
(gdb) x/40i main
0x40b6a0 <main>: push %r15
0x40b6a2 <main+2>: mov %rsi,%r15
0x40b6a5 <main+5>: push %r14
0x40b6a7 <main+7>: xor %r14d,%r14d
0x40b6aa <main+10>: push %r13
0x40b6ac <main+12>: push %r12
0x40b6ae <main+14>: push %rbp
0x40b6af <main+15>: mov $0x1,%ebp
0x40b6b4 <main+20>: push %rbx
0x40b6b5 <main+21>: sub $0x40858,%rsp
only 256KB stack allocated!
For threading program this produce stack overeflow.</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>