Gale Paeper wrote:
In looking at the actual generated PPC assembly code for the trash procedure in nonloc2goto.pas and the trash function in nonloc4goto.pas, both end up using an 80 byte stack frame.
I'm at a loss to explain why the stack frame is so large. There is nothing in the assembly code for those two routines which would require that large of a stack frame but that's what the compiler generates.
Thanks for your comments to my previous post. I am experimenting a bit now and I think it has something to do with the --inline-functions flag, that is turned on by -O3. Without the --inline-functions flag, there is no stack overflow.
Just to be sure that this is a possible powerpc code generation problem - how much stack does the following program eat on other platforms, with -O3 optimizations ? To find out, use the shell's setlimit command, or is there a better method ?.
program test(output);
procedure trash(n: integer); begin if n>0 then trash(n-1) end;
begin trash(10000); writeln('OK') end.
Regards,
Adriaan van Os