Implementing alloca with malloc

Fergus Henderson fjh@cs.mu.OZ.AU
Mon Jul 28 17:03:00 GMT 2003


On 28-Jul-2003, Stephen Biggs <xyzzy@hotpop.com> wrote:
> GCC 3.2, I need to implement alloca in the back-end without messing with
> the stack. I see in the docs that I can probably use malloc with the
> expression for the var in the "allocate_stack" insn, no problem.  How do
> I then free it?

Have a look at the alloca() implementation in libiberty/alloca.c.
You can probably use that.

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.



More information about the Gcc mailing list