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

--- Comment #11 from H.J. Lu <hjl.tools at gmail dot com> ---
(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

should be disallowed.  For !TARGET_64BIT, only

        kmovd   foo@gotntpoff(%eax), %k0
        kmovd   foo@tpoff(%eax), %k0

should be disallowed.

>           return false;
>         default:
>           break;
>         }
>       /* Should iter.skip_subrtxes ();
>        if there's no inner UNSPEC in addr???.  */
>     }
> 
>   return true;
> }

Reply via email to