[tree-ssa] Fix variables getting out of their scope

Daniel Berlin dberlin@dberlin.org
Sun Aug 10 21:21:00 GMT 2003



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.



More information about the Gcc-patches mailing list