Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: jtw@lcs.mit.edu (John Wroclawski)
Subject: Re: Need alloca which allocates storage IN the stack frame (Ultrix)
Date: Thu, 21 Jan 1993 22:58:27 GMT	[thread overview]
Message-ID: <JTW.93Jan21175827@pmws.lcs.mit.edu> (raw)
In-Reply-To: timv@ccad.uiowa.edu's message of 21 Jan 93 16:30:51 GMT


   From: timv@ccad.uiowa.edu (Timothy VanFosson)

   Thanks for the response, but (as you point out) I neglected to mention
   that this is for a DECStation 5000/200.  Thanks also to those who
   have suggested GNU Emacs/GCC alloca(), but it works (doesn't work :-)
   in the same manner as the DEC alloca() -- the storage allocated is
   not IN the stack.  I had already tried it before I posted.

   I am still looking for an (assembly) version of alloca() which
   does manipulate the stack to allocate storage.

The problem here is that since the Mips calling standard does not
require the use of a frame pointer (and in fact an FP is almost never
used in optimized code), implementing an in-stack alloca requires some
help from the compiler (because you must move the stack pointer, but
the SP is used to reference local variables.

The decstation version of GCC provides this support. So does the
standard Ultrix C compiler, but you must include <alloca.h> or 
"#define alloca __builtin_alloca" in any file that needs it. However,
as I recall the version built in to the standard compiler has some
limitations, which are documented in <alloca.h> and perhaps elsewhere.

John Wroclawski
MIT Lab for Computer Science
jtw@lcs.mit.edu


  reply	other threads:[~1993-01-21 22:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-01-19 20:40 Need alloca which allocates storage IN the stack frame (Ultrix) Timothy VanFosson
1993-01-20 14:52 ` zrepachol
1993-01-21 11:16 ` Don Stokes
1993-01-21 16:30   ` Timothy VanFosson
1993-01-21 22:58     ` John Wroclawski [this message]
1993-01-22 14:47       ` Marcus J Ranum
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox