On Wed, 2009-05-06 at 17:55 +0200, Michael Matz wrote:
> Hi,
> 
> On Wed, 6 May 2009, Richard Earnshaw wrote:
> 
> > > The easiest solution would be to just make a note that you need the 
> > > PIC register and then, when expanding the prologue emit the necessary 
> > > instructions.  IMO that makes sense as PIC register setup usually is 
> > > something the prologue does, like all the other register setups 
> > > necessary.
> > 
> > That won't work because the PIC register on ARM is a pseudo, so 
> > generating it during prologue generation is too late.  It needs to exist 
> > before data flow analysis starts on the RTL.
> 
> That's fine.  You can generate the pseudo, just not emit the code to load 
> it until prologue generation starts.  Dataflow analysis starts only after 
> everything is expanded to RTL anyway.  I'll try to cobble up a patch to 
> show what I mean, but obviously I'm not very fluent with the ARM backend.

Sorry, I'm confused.  Prologue generation happens after register
allocation (it can't be otherwise since we don't know which registers
have to be saved).  The PIC register has to appear as being live at the
start of the function so that the uses of it don't appear to be magic.

R.

Reply via email to