Path: utzoo!mnetor!tmsoft!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!dsinc!bagate!cbmvax!cbmehq!cbmdeo!lenler!moria!bojsen From: bojsen@moria.UUCP (Per Bojsen) Newsgroups: comp.sys.amiga.programmer Subject: Re: AmigaGCC stack hogging Message-ID: <18a44b2e.ARN1fba@moria.UUCP> Date: 6 Feb 91 21:58:54 GMT References: <1882f287.ARN1979@moria.UUCP> <1991Jan14.212254.9779@csun.edu> <18887df5.ARN1ad7@moria.UUCP> <1991Jan17.141218.19953@zorch.SF-Bay.ORG> <390@vixen.uucp> Reply-To: bojsen@moria.dc.dth.dk Followup-To: comp.sys.amiga.programmer Organization: IDUN-Soft Aps. Lines: 39 In article <390@vixen.uucp>, Ron Hitchens writes: > > I've been thinking about this problem since it came up in this group > and I think I may have a good compromise solution. > Unfortunately, I think your solution won't work! See below. > > [A large description of Ron's proposed scheme deleted] > > The calls to push_alloca() and pop_alloca() would be automatically > generated as part of the FUNCTION_PROLOGUE and FUNCTION_EPILOGUE macros > which are defined in the tm.h header file in gcc, preferably conditional > on a run-time switch. > I believe you've misunderstood the purpose of the prologue/epilogue macros! They are _not_ used for the functions in `gcc', _but_ are used in the code generator part of `gcc' to generate the code for function entry/exit. I.e., these two macros are the instructions to generate the assembly code that constitutes function prologue/epilogue in code _generated_ by `gcc', _not_ in `gcc' itself! Besides, there already exists a version of alloca() which does a fair amount of resource tracking and which uses malloc(). This alloca.c module is distributed with most (if not all) GNU programs, including `gcc'. Since I did my original posting (which started this thread) I have done some investigation on the reasons for `gcc's stack hogging. It unfortunately turned out that the reported stack usage of 100-200K was for versions using the malloc'ing alloca()!!! So `gcc' has a real need for a lot of stack! -- .------------------------------------------------------------------------------. | Greetings from Per Bojsen. | +-------------------------------+----------------------------------------------+ | EMail: cbmehq!lenler!bojsen |"Zen is a feeling. It's the feeling you get | | Or: bojsen@dc.dth.dk | when you know you're going to get a feeling."| `-------------------------------+----------------------------------------------'