From: Vangelis R. <vr...@ot...> - 2004-10-22 19:25:30
|
On Fri, 22 Oct 2004, Erik Petrich wrote: > On a second look, I think I see a fairly simple solution. SDCCast.c's > createFunction() already handles other cases of discontinuities on the > stack between a function's parameters and its local variables; we could > simply add something like: > > if (IFFUNC_ISCRITICAL (name->type)) > stackPtr -= port->stack.direction * port->stack.critical_overhead; > > with the appropriate additions to port.h, */main.c, and */gen.c (of > course, the port implementation can set port->stack.critical_overhead to 0 > if this change in behavior is inconvenient or undesired and leave the > backend code generator alone). Nice approach. I agree with you and implement it like this. There is no point in having a 'critical' function that might crash from time to time! BTW, critical isn't yet implemented in pic16, I'll fix this in the next weeks. Your proposal also gave me other ideas on how to handle stack offsets. Currently I have an ad hoc offset mechanism to modify stack offsets. Modifying createFunction() would give standard and more robust results. regards, Vangelis |