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] Fix variables getting out of their scope


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


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