On Fri, Oct 26, 2012 at 11:42:20AM -0600, Jeff Law wrote:
> On 10/26/2012 12:30 AM, Alexandre Oliva wrote:
> >Propagate debug stmts for jump threading

> >for  gcc/ChangeLog
> >
> >     PR debug/54693
> >     * tree-ssa-threadedge.c (thread_around_empty_block): Copy
> >     debug temps from predecessor before threading.
> So my only concerns here are what happens when we copy the debug
> statements, but end up not threading the jump.  At this stage we're
> just recording the jump threading opportunities; only a subset of
> the registered jump threading opportunities will be optimized.
> 
> So will these new debug statements cause problems if the jump isn't
> threaded?  Closely related, do these new debug statements need to be
> rewritten into SSA form?  If so we have a problem if we copy the
> debug statements, but ultimately thread no jumps at all.  In that
> scenario we don't update the SSA graph.

The debug stmts are already in SSA form, and, being debug stmts, they are
always just consumers of SSA names, not defining stmts, and Alex' patch
is just copying them over from a predecessor bb to a successor bb that
has a single predecessor (the one from which they are copied).
So, all SSA names that are used in debug stmts in the predecessor must
be still valid at the beginning of the successor bb.  If the successor
has any debug stmts on its own, they will go after these copied ones
and thus override anything in them if they need to.

        Jakub

Reply via email to