This is the mail archive of the
mailing list for the GCC project.
Re: Further observations regarding alloca on i586-pc-linux-gnu
- To: Martin von Loewis <martin at mira dot isdn dot cs dot tu-berlin dot de>, rth at cygnus dot com
- Subject: Re: Further observations regarding alloca on i586-pc-linux-gnu
- From: Richard Henderson <rth at cygnus dot com>
- Date: Sun, 23 Aug 1998 15:57:04 -0700
- Cc: carlo at runaway dot xs4all dot nl, egcs-bugs at cygnus dot com, pommnitz at darmstadt dot gmd dot de, egcs at cygnus dot com
- References: <firstname.lastname@example.org> <199808221724.TAA14230@jolan.ppro> <19980823043600.A4080@dot.cygnus.com> <199808231820.UAA00204@mira.isdn.cs.tu-berlin.de>
- Reply-To: Richard Henderson <rth at cygnus dot com>
On Sun, Aug 23, 1998 at 08:20:05PM +0200, Martin von Loewis wrote:
> > Note that the exact same effect would happen if alloca was not a
> > builtin.
> No, it wouldn't. The portable alloca would not reclaim the memory
> until the next alloca call, and then only if the previous call was
> deeper on stack.
No no, I meant the olde tyme non-portable alloca. You know:
alloca: popl %edx
subl %eax, %esp
movl %esp, %eax
> > Note that if you mind sequence points like you ought, you get
> > correct results.
> The original example was using alloca as a default argument. It seems
> that g++ currently does not support that, an alloca call must occur as
> a full expression in itself, not inside a full expression.
"Full expression" isn't a term I'm familiar with. Besides,
(tmp = alloca(n), foo(tmp, blah));
works just fine. It seems that alloca must be the first thing
after a sequence point. How to enforce or even warn about this
I have absolutely no idea.