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
Hello,
> 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.
changing the type should not be too bad issue IMHO, as long as user
knows about it.
> 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.
I of course also started with this approach. The problem is that it
does not fit very well with rest of optimizations -- how will you
express the dependencies it creates, especially that you cannot use
the variable before it is allocated (this might be an issue with some
code motion optimizations)? When the type is changed, it is just
straightforward (you don't have to do anything). Without it you have
to design something for this, because such variable does not behave the
same way normal variables do.
> > 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;)
Zdenek