This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: alloca + inline


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]