This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Lowering of VLA's
- From: law at redhat dot com
- To: Andrew MacLeod <amacleod at redhat dot com>
- Cc: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>, Jason Merrill <jason at redhat dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 25 Aug 2003 15:13:14 -0600
- Subject: Re: [tree-ssa] Lowering of VLA's
- Reply-to: law at redhat dot com
In message <1061832758.3649.84.camel@p4>, Andrew MacLeod writes:
>On Mon, 2003-08-25 at 13:18, Zdenek Dvorak wrote:
>> Hello,
>>
>
>> > > This change does not yet make VLA's fully independent on enclosing BIND
>_EXPR,
>> > > since there is the stack deallocation part that is still carried by
>> > > BIND_EXPR; changes to make this explicit should follow.
>> >
>> > Hmm. I suppose that means introducing some concept of stack management
>> > into tree-ssa?
>>
>> It should be enough to have magic statements STACK_SAVE and
>> STACK_RESTORE (used like
>>
>> stack_temp = STACK_SAVE;
>> ...
>> STACK_RESTORE stack_temp;)
>>
>
>I hope we dont have to go teaching all the existing optimizations about
>new tree codes...
>
>do we really reclaim stack space coming out of a BIND_EXPR?
Yes. I originally thought we did not. I was wrong :(
> Do we
>allocate space with alloca? is there a dealloca()? I wasnt aware of it.
It's not really alloca -- we just adjust the stack/frame pointers as needed.
Though that's in reality the same thing alloca does -- except that alloca
implicitly deallocates when the function exits, whereas VLAs implicitly
deallocate when their binding contour exits.
Jeff