SRA: don't drop clobbers

Jakub Jelinek jakub@redhat.com
Thu Jul 10 15:01:00 GMT 2014


On Thu, Jul 10, 2014 at 04:54:53PM +0200, Richard Biener wrote:
> > +  else if (access->grp_to_be_debug_replaced)
> > +    {
> 
> Why would we care to create clobbers for debug stmts?!  Are those
> even valid?

It is not valid.  Though, the fields supposedly live nowhere after the
clobber, so perhaps one could use
GIMPLE_DEBUG_BIND_NOVALUE instead of the clobber in the
gimple_build_debug_bind call, and drop the previous two lines.
Not sure if it is desirable though, it might cause the debug info to say
something is unavailable even if it still lives in some register or memory
for a few extra instructions.

Alex, what do you think?

> > +      tree rep = get_access_replacement (access);
> > +      tree clobber = build_constructor (access->type, NULL);
> > +      TREE_THIS_VOLATILE (clobber) = 1;
> > +      gimple ds = gimple_build_debug_bind (rep, clobber, gsi_stmt (*gsi));
> > +
> > +      if (insert_after)
> > +       gsi_insert_after (gsi, ds, GSI_NEW_STMT);
> > +      else
> > +       gsi_insert_before (gsi, ds, GSI_SAME_STMT);
> > +    }
> > +
> > +  for (child = access->first_child; child; child = child->next_sibling)
> > +    clobber_subtree (child, gsi, insert_after, loc);
> > +}
> > +

	Jakub



More information about the Gcc-patches mailing list