This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, ARM] Use a pseudo for the PIC base
On Wed, 18 Jan 2006 01:01:08 GMT, Paul Brook wrote:
> On Wednesday 18 January 2006 00:51, Richard Earnshaw wrote:
> > On Tue, 17 Jan 2006 16:04:24 PST, Richard Henderson <rth@redhat.com>
> >
> > wrote:
> > > On Tue, Jan 17, 2006 at 08:29:48PM +0000, Richard Earnshaw wrote:
> > > > It seems that contrary to traditional belief no further changes to the
> > > > mid-end code are needed.
> > >
> > > How do you handle constants being spilled to memory during reload,
> > > in a block for which the pic pseudo register was not previously live?
> >
> > I've never seen it happen in any testing, and I've seen a fair number of
> > cases where reload was affecting the code. If the pic base can't have a
> > hard register it just gets split and reloaded as a normal pseudo. The sum
> > of the pic base plus one of the offsets, isn't recorded as a constant, so
> > I guess reload would never just throw it away.
>
> Could it be because of the way the Arm backend does its own constant pool
> generation? ie. reload never tries to spill constants to a PIC-base relative
> address.
>
> Paul
>
I don't think so.
AFAICT reload will only throw a value away if it is in reg_equiv_constant.
But that is only set if the value is accepted by LEGITIMATE_CONSTANT_P,
and that doesn't include anything that includes the PIC base, since that's
not wrapped in (const (...))
R.