https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103275

--- Comment #10 from Hongtao.liu <crazylht at gmail dot com> ---
I'm working on a patch which adds a new memory constraint "Bk" which will
exclude TLS UNSPECs for mask register alternative.

The UNSPEC i'm excluding is like below, any other UNSPEC needs to be added?

bool
ix86_notls_memory (rtx mem)
{
  gcc_assert (MEM_P (mem));

  rtx addr = XEXP (mem, 0);
  subrtx_var_iterator::array_type array;
  FOR_EACH_SUBRTX_VAR (iter, array, addr, ALL)
    {
      rtx op = *iter;
      if (GET_CODE (op) == UNSPEC)
        switch (XINT (op, 1))
          {
          case UNSPEC_GOTTPOFF:
          case UNSPEC_GOTNTPOFF:
          case UNSPEC_TP:
          case UNSPEC_TLS_GD:
          case UNSPEC_TLS_LD_BASE:
          case UNSPEC_TLSDESC:
          case UNSPEC_TLS_IE_SUN:
            return false;
          default:
            break;
          }
      /* Should iter.skip_subrtxes ();
         if there's no inner UNSPEC in addr???.  */
    }

  return true;
}

Reply via email to