On Mon, Mar 20, 2006 at 04:03:08PM -0000, Dave Korn wrote: > Do you happen to know off the top of your head when get_frame_size() > becomes valid?
You don't get a good first-pass estimate until after all rtl generation has been done. Which is later than you need. Another possibility is to allocate an extra word high in the stack frame for temporary storage in large frames w/ sibcalls to functions using all arguments. Then you'd deallocate in several steps: scratchslot = argument argument = stack frame size - small sp += argument argument = scratchslot sp += small This scheme has the advantage that you don't need to commit to it until the last minute. Don't forget that you can also handle "small" large values in a small number of steps. E.g. for 65k: sp += 32764 sp += 32764 sp += 1032 Which may well be faster than going through memory as above. Of course, you wouldn't want to use this scheme for a 2mb frame. r~