On Thu, 17 Nov 2016, Jeff Law wrote:

> On 11/17/2016 01:20 AM, Richard Biener wrote:
> > On Wed, 16 Nov 2016, Jeff Law wrote:
> > 
> > > On 10/28/2016 05:51 AM, Richard Biener wrote:
> > > > 
> > > > These are the middle-end changes and additions to the testsuite.
> > > > 
> > > > They are pretty self-contained, I've organized the changelog
> > > > entries below in areas of changes:
> > > > 
> > > >  1) dump changes - we add a -gimple dump modifier that allows most
> > > >  function dumps to be directy fed back into the GIMPLE FE
> > > > 
> > > >  2) pass manager changes to implement the startwith("pass-name")
> > > >  feature which implements unit-testing for GIMPLE passes
> > > > 
> > > >  3) support for "SSA" input, a __PHI stmt that is lowered once the
> > > >  CFG is built, a facility to allow a specific SSA name to be allocated
> > > >  plus a small required change in the SSA rewriter to allow for
> > > >  pre-existing PHI arguments
> > > > 
> > > > Bootstrapped and tested on x86_64-unknown-linux-gnu (together with
> > > > [1/2]).
> > > > 
> > > > I can approve all these changes myself but any comments are welcome.
> > > My only worry would be ensuring that in the case where we're asking for a
> > > particular SSA_NAME in make_ssa_name_fn that we assert the requested name
> > > is
> > > available.
> > > 
> > > ISTM that if it's > the highest current version or in the freelist, then
> > > we
> > > ought to be safe.   If it isn't safe then we should either issue an error,
> > > or
> > > renumber the preexisting SSA_NAME (and determining if it's safe to
> > > renumber
> > > the preexisting SSA_NAME may require more context than we have).
> > 
> > An alternative interface would be to return NULL rather than asserting.
> > OTOH the single caller requesting a specific version first does a lookup
> > if the SSA name already exists, so it is safe.
> I have a slight preference for enforcing safety within the name manager, but I
> can live with doing the checking in the caller.

Actually safety is enforced by means of an assert ... the caller would 
have to check anyway (for a NULL result).  IMHO doing tricks like
re-numbering on already taken versions doesn't make sense as that doesn't
guarantee earlier assigned versions stay the same.

It's really a special thing for the parser which wants to preserve
SSA name versions as in the source.

Richard.

Reply via email to