This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Fix variables getting out of their scope
- From: Andrew MacLeod <amacleod at redhat dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>, Diego Novillo <dnovillo at redhat dot com>, Daniel Berlin <dberlin at dberlin dot org>, Zdenek Dvorak <rakdver at kam dot mff dot cuni dot cz>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>
- Date: 11 Aug 2003 18:17:38 -0400
- Subject: Re: [tree-ssa] Fix variables getting out of their scope
- References: <200308112209.h7BM948L003340@speedy.slc.redhat.com>
On Mon, 2003-08-11 at 18:09, law@redhat.com wrote:
> In message <20030811191953.GB7767@atrey.karlin.mff.cuni.cz>, Zdenek Dvorak writ
> es:
> >
> >Then there are two problems:
> >1) moving variables to the outer scope might pessimize the code a bit.
> Possibly.
>
> >Now when the variables are in disjoint scopes, they may get the same
> >stack slot assigned (if any). Not really sure whether we use this,
> >though.
> Addressable variables in disjoint scopes are allowed to share stack slots.
> However, we shouldn't be extending the lifetime of anything addressable.
>
> [ Note that I'm not advocating fixing this problem, just clarifying what
> happens in the backend. ]
>
>
> Note that blindly moving variables to an outer scope may have impacts on
> languages were variables are constructed/destructed -- suddenly the destructors
> don't run when you expect them.
>
In my comments, I was only thinking of scalars which are not
addressable, I should have clarified that... I guess it was kind of
implicit in the 'as long as its been renamed by the SSA pass' comment,
but not clear without thinking about it. :-)
Andrew