This is the mail archive of the gcc-patches@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: [tree-ssa] Lowering of VLA's


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


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