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: Diego Novillo <dnovillo at redhat dot com>
- To: Daniel Berlin <dberlin at dberlin dot org>
- Cc: Zdenek Dvorak <rakdver at kam dot mff dot cuni dot cz>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>
- Date: Sun, 10 Aug 2003 17:28:07 -0400
- Subject: Re: [tree-ssa] Fix variables getting out of their scope
- Organization: Red Hat Canada
- References: <20030810203732.GA27897@kam.mff.cuni.cz> <1060550000.27906.88.camel@frodo.toronto.redhat.com> <Pine.LNX.4.56.0308101719250.22660@dberlin.org>
On Sun, 2003-08-10 at 17:21, Daniel Berlin wrote:
> On Sun, 10 Aug 2003, Diego Novillo wrote:
>
> > [ Adding gcc-patches. The original message was mis-addressed. ]
> >
> > On Sun, 2003-08-10 at 16:37, Zdenek Dvorak wrote:
> > > Hello,
> > >
> > > this patch fixes the problem with variables being copy-propagated out
> > > of their scope, by moving their declaration to the top-most bind_expr
> > > if it occurs.
> > >
> > I'm not sure this is a valid transformation. I believe that it disrupts
> > debugging information. Jason?
>
> It only occurs with optimization, which makes it okay.
>
>
> >
> > If not, then I would vote for moving *all* local declarations to the top
> > BIND_EXPR and remove all BIND_EXPRs inside the function. IIRC, I once
> > suggested something along those lines but it didn't turn out to be a
> > good idea because it would break debugging info.
> This would break debugging regardless of optimization level. Zdenek's
> change only causes debugging info to break when we can't avoid it.
> One is acceptable to gcc, the other is not.
>
Moving all local declarations to the top BIND_EXPR would only occur with
optimization. By what you said earlier, it should also be OK. I don't
understand the distinction you're making here.
Diego.