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 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.


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