[LLVMbugs] [Bug 18420] New: Stack overflow in generated code.
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Wed Jan 8 02:31:33 PST 2014
http://llvm.org/bugs/show_bug.cgi?id=18420
Bug ID: 18420
Summary: Stack overflow in generated code.
Product: clang
Version: 3.3
Hardware: PC
OS: FreeBSD
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
Assignee: unassignedclangbugs at nondot.org
Reporter: slw at zxy.spb.ru
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
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.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140108/ecb82996/attachment.html>
More information about the llvm-bugs
mailing list