On Sat, Feb 10, 2018 at 02:09:57PM +1030, Alan Modra wrote:
> On Fri, Feb 09, 2018 at 08:11:44AM -0600, Segher Boessenkool wrote:
> > On Fri, Feb 09, 2018 at 04:12:47PM +1030, Alan Modra wrote:
> > >  ;; Use r0 to stop regrename twiddling with lr restore insns emitted
> > >  ;; after the call to __morestack.
> > >  (define_insn "split_stack_return"
> > > -  [(unspec_volatile [(use (reg:SI 0))] UNSPECV_SPLIT_STACK_RETURN)]
> > > +  [(unspec_volatile [(use (reg:SI 0)) (use (reg:SI LR_REGNO))]
> > > +             UNSPECV_SPLIT_STACK_RETURN)]
> > 
> > I'm not sure what a USE as input of an UNSPEC means -- it should work
> > without the USEs?
> 
> Hmm, yes, plain [(reg:SI 0) (reg:SI LR_REGNO)] ought to work.  A sniff
> test says it's OK but I'll do the whole bootstrap/regtest cycle before
> committing.  I'm not sure why I put the USE there for r0, probably
> because I had the r0 dependency outside the unspec initially then
> decided it could replace (const_int 0) inside the unspec vector to
> save on useless RTL.  I didn't go far enough in trimming the RTL..

For R0 you can use a USE I think, but it should be in a parallel with
the unspec then.  But LR more appropriately is an input to the unspec,
it's not just there to keep the register alive for <some reason>.

Having both as inputs works of course.


Segher

Reply via email to