This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: alloca + inline
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: dewar at gnat dot com (Robert Dewar)
- Cc: gdr at integrable-solutions dot net, sxanth at ceid dot upatras dot gr, gcc at gcc dot gnu dot org
- Date: 16 Mar 2003 16:31:15 -0300
- Subject: Re: alloca + inline
- Organization: GCC Team, Red Hat
- References: <20030316145213.5CD61F2DE3@nile.gnat.com>
On Mar 16, 2003, dewar at gnat dot com (Robert Dewar) wrote:
> You may see things this way, but C does not, inlining should be
> semantically neutral. It should not change the behavior of a well
> defined program, if it does, as in this case, it is a bug!
'cept alloca is not a Standard C function, so there are no guarantee
about its behavior. In fact, there are a number of
library-implementations of alloca that do not free storage at all, or
that free it only when alloca is called in the same thread with a
different (higher or lower, depending on stack direction ) stack
pointer. There's nothing illegal about them, and there's nothing
illegal about inlining functions that call alloca, IMHO. We used not
to do this with the RTL inliner because we couldn't. When we switched
to the tree inliner, I didn't see a reason to retain that limitation,
so I took it out. Seems like others disagree.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva at {redhat dot com, gcc.gnu.org}
CS PhD student at IC-Unicamp oliva at {lsd dot ic dot unicamp dot br, gnu.org}
Free Software Evangelist Professional serial bug killer