This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: MIPS TLS support
On Thu, Mar 10, 2005 at 07:31:51PM +0000, Richard Sandiford wrote:
> Daniel Jacobowitz <drow@false.org> writes:
> > On Wed, Mar 09, 2005 at 10:36:30PM +0000, Richard Sandiford wrote:
> >> > + if (Pmode == DImode)
> >> > + emit_insn (gen_tls_gd_di (a0, gp, loc));
> >> > + else
> >> > + emit_insn (gen_tls_gd_si (a0, gp, loc));
> >
> > This appears to be wrong - before reload, we don't know what register
> > the global pointer will be in. I'm pretty confused.
> >
> > mips_global_pointer checks regs_ever_live[GLOBAL_POINTER_REGNUM], but
> > if it returns something besides GLOBAL_POINTER_REGNUM in this case,
> > won't the previous uses be bogus?
>
> You should just be able to use pic_offset_table_rtx. It's a shared
> rtx, so if the backend decides to change the register, all uses are
> automatically affected.
That, my friend, is way down their in the "stupid RTL tricks" handbook.
It's on page three million and twelve, in a footnote. That must be how
I missed it.
--
Daniel Jacobowitz
CodeSourcery, LLC