LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 331 - [X86/win32] Large allocas need incremental stack probing
Summary: [X86/win32] Large allocas need incremental stack probing
Status: RESOLVED FIXED
Alias: None
Product: libraries
Classification: Unclassified
Component: Backend: X86 (show other bugs)
Version: 1.0
Hardware: All All
: P normal
Assignee: Anton Korobeynikov
URL:
Keywords: miscompilation
Depends on:
Blocks: 790
  Show dependency tree
 
Reported: 2004-05-01 07:46 PDT by Chris Lattner
Modified: 2010-02-22 12:44 PST (History)
2 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Lattner 2004-05-01 07:46:05 PDT
It looks like windows cannot grow the stack by more than 4K at a time, judging
by some code in the C front-end that LLVM doesn't use:
http://llvm.cs.uiuc.edu/cvsweb/cvsweb.cgi/llvm-gcc/gcc/config/i386/cygwin.asm?rev=1.1.1.1&content-type=text/x-cvsweb-markup

To fix this, we should either support an out-of-line alloca on windows like GCC
does, or inline the relevant code (which is probably a bad idea for something
this large).

-Chris
Comment 1 Chris Lattner 2006-06-13 00:36:59 PDT
This patch fixed the static case:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20060612/035516.html

Now just dynamic alloca's need to be addressed.

-Chris
Comment 2 Anton Korobeynikov 2006-06-16 02:09:20 PDT
What does it mean "dynamic alloca"? Where can I catch them? Are there any
suitable example?
Comment 3 Chris Lattner 2006-06-16 11:33:33 PDT
I mean code like this:

#include <alloca.h>
void foo(int N) {
  bar(alloca(N));
}

or:
void foo(int N) {
  int A[N];
  bar(A);
}
Comment 4 Anton Korobeynikov 2007-04-16 16:49:53 PDT
Static fix is not so good actually :( It bet it won't work for
regparm'ed\fastcall functions, when there are incoming arguments in eax.
However, I'm not sure. Will check.
Comment 5 Anton Korobeynikov 2007-04-16 16:50:17 PDT
Yes, it's mine :)