https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103275
--- Comment #14 from Hongtao.liu <crazylht at gmail dot com> ---
(In reply to H.J. Lu from comment #11)
> (In reply to Hongtao.liu from comment #10)
> > 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:
>
> This doesn't look right. For TARGET_64BIT, only
>
> kmovq foo@gottpoff(%rip), %k0
> kmovq foo@tlsld(%rip), %k0
It looks like gcc won't generate kmovq foo@tlsld(%rip), %k0, but only leaq
("lea{q}\t{%&@tlsld(%%rip), %%rdi|rdi, %&@tlsld[rip]}", operands);