On 2012-07-11, at 3:44 PM, Jim Ursetto wrote: > It seems that compiling with clang (llvm 3.0) > prevents the crash, at least for values up to 20 million, on > OS X and Linux. Any higher and I start to hit swap. > I don't know why this works. > > Plain gcc on linux, and llvm-gcc (llvm 2.7) on OS X 10.7, do crash > at about 600k here w/ stack ulimit 8M. Based on your results > I am guessing your stack ulimit is 4M. > > Tried removing __attribute__((noreturn)) from chicken.h, as is done > for clang and it made no difference, as you'd expect. Only > other difference from gcc is the stack pointer retrieval code but > that is identical between clang and llvm-gcc. So I have to > assume LLVM 3.0 has something to do with the crash avoidance, > which could very well be luck. > > Tested with Chicken 4.7.0.6. > > Jim
I'm pretty sure LLVM is simply implementing the tail-call itself. So there is no stack growth in the unwinding phase. Unfortunately, one can't rely on the C compiler doing this in general. Marc _______________________________________________ Chicken-users mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/chicken-users
