Chung-Lin Tang <clt...@codesourcery.com> writes:
> @@ -2851,11 +2851,12 @@ mips_call_tls_get_addr (rtx sym, enum mips_symbol_
>  /* Return a pseudo register that contains the current thread pointer.  */
>  
>  static rtx
> -mips_get_tp (void)
> +mips_get_tp (rtx target)
>  {
> -  rtx tp, fn;
> +  rtx fn;
> +  rtx tp = (target != NULL_RTX && REG_P (target)
> +         ? target : gen_reg_rtx (Pmode));
>  
> -  tp = gen_reg_rtx (Pmode);
>    if (TARGET_MIPS16)
>      {
>        mips_need_mips16_rdhwr_p = true;

Sorry for being fussy, but let's do it the other way around:
rename mips_get_tp to mips_expand_builtin_thread_pointer:

/* Implement TARGET_EXPAND_BUILTIN_THREAD_POINTER.  */

static rtx
mips_expand_builtin_thread_pointer (rtx tp)
{
  rtx fn;

  if (TARGET_MIPS16)
    ...
}

(i.e. always using the passed-in tp, which is safe with your 1/6 patch),
then change mips_get_tp as follows:

/* Return a pseudo register that contains the current thread pointer.  */

static rtx
mips_get_tp (void)
{
  return mips_expand_builtin_thread_pointer (gen_reg_rtx (Pmode));
}

OK with that change, thanks.

Richard

Reply via email to