This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: -fomit-frame-pointer interaction with alloca - egcs-1.0.1
- To: John Hughes <john at AtlanTech dot COM>
- Subject: Re: -fomit-frame-pointer interaction with alloca - egcs-1.0.1
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Thu, 05 Feb 1998 11:31:29 -0700
- cc: "Egcs-Bugs Mailing list (E-mail)" <egcs-bugs at cygnus dot com>
- Reply-To: law at cygnus dot com
In message <01BD325D.B623F8C0@malvinas.AtlanTech.COM>you write:
> The "-fomit-frame-pointer" option interacts poorly with alloca.
>
> If a function contains a call to alloca then -fomit-frame-pointer seems to
> get turned off.
>
> This is a pity.
>
> What's worse is that some parts of egcs don't seem to know and carry on as
> if -fomit-frame pointer was still in effect, generating unnecessary stack
> pointer manipulations.
It's not really feasible to do either optimziation you've requested.
alloca'd memory is not released until the end of a function, and in general
you don't know much memory was alloca'd. Thus you must have a frame pointer
so that you can correctly restore the stack pointer.
If you tried to release alloca'd memory in the middle of a function you'd
probably find out that you'd need a frame pointer at each program join
point.
jeff