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
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
What does it mean "dynamic alloca"? Where can I catch them? Are there any suitable example?
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); }
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.
Yes, it's mine :)
Fixed here (both issues): http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070416/047911.html http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070416/047912.html http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070416/047913.html Testcase here: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070416/047910.html