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


Hello,

> > It makes the place on stack for them to be allocated explicitely.  There
> > are little technical problems with this step -- it turned out to be
> > necessary to replace all references to the object with a pointer (since
> > dynamic stack allocation really is a set to pointer).
> 
> I looked at this problem a bit a few months back; indeed, this sort of
> thing is another aspect of the problem with referring directly to variables
> that live in memory rather than by explicit pointer (as in LLVM).
> 
> I was reluctant to make this sort of change because of the impact on
> debugging information--I want the type of the decl to remain the same for
> the benefit of gdb.
> 
> One possibility would be to create a separate pointer decl, replace uses
> of the vla with uses of the pointer, and associate the two decls at RTL
> expansion time.
> 
> However, if you're going to introduce a whole new tree code anyway, I don't
> think you need to bother with switching to a pointer representation.  When
> I was looking at this before, I generated the following incomplete patch,
> which seems like a simpler approach.

this patch indeed seems nicer than the one I played with before.  If
noone protests, I will take this as a basis, make the
EXPAND_DECL_EXPR/STACK_ALLOC a builtin and merge a few bits I consider
useful from my patch into it.

Zdenek


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