This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix ix86_split_long_move collision handling with TLS (PR target/66470)
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 9 Jun 2015 18:16:32 +0200
- Subject: Re: [PATCH] Fix ix86_split_long_move collision handling with TLS (PR target/66470)
- Authentication-results: sourceware.org; auth=none
- References: <20150609115739 dot GZ10247 at tucnak dot redhat dot com> <CAFULd4aqtXddc6HGnMgXbnhkcGmXEH6jrFjrOmLsZOW7X0KaLQ at mail dot gmail dot com> <20150609125703 dot GA10247 at tucnak dot redhat dot com> <CAFULd4Zv0yo6tRWE8WvW9OqAs8U-kf=woHnAWLWwB9KBBDzoAA at mail dot gmail dot com> <20150609133905 dot GB10247 at tucnak dot redhat dot com> <CAFULd4ZVP0UVe7SzGk0aZLMcJ3qfQ=-TThK03GR5_FbB7U=_LQ at mail dot gmail dot com> <20150609142638 dot GC10247 at tucnak dot redhat dot com>
On Tue, Jun 9, 2015 at 4:26 PM, Jakub Jelinek <jakub@redhat.com> wrote:
>> >> I'm afraid that simple scan loop won't work correctly on x32. There
>> >> are some issues with UNSPEC_TP for this target, so we have to generate
>> >> zero_extend of SImode UNSPEC, e.g.:
>> >>
>> >> (plus:DI (zero_extend:DI (unspec:SI [...] UNSPEC_TP) (reg:DI ...))
>> >>
>> >> as can be seen in get_thread_pointer to construct the address. It
>> >> looks that your loop won't find the UNSPEC_TP tag in the above case.
>> >
>> > You're right, for -m32 it would need to start with
>
> Yeah, I meant -mx32 (which I have no experience with nor spare time for).
>
>> > rtx *x = &addr;
>> > + while (GET_CODE (*x) == ZERO_EXTEND
>> > + || GET_CODE (*x) == AND
>> > + || GET_CODE (*x) == SUBREG)
>> > + x = &XEXP (*x, 0);
>>
>> Oh, you can use SImode_address_operand predicate here.
>
> Do I need to loop, or can there be just one SImode_address_operand
IIRC, apart from the whole address, only UNSPEC_TP can be
zero_extended. It is a hardware "feature" (== HW bug) that addr32
doesn't apply to segment registers.
> code? Do you want to use the iterators (as in the second patch) or not
> (then is
> if (SImode_address_operand (addr, VOIDmode))
> x = &XEXP (addr, 0);
> ok)? Is Pmode always SImode for -mx32, or depending on some switch or
Nope, it depends on -maddress-mode switch, and can be SImode or DImode.
> something? Would it be acceptable to just guard the changes in the patch
> with !TARGET_X32 and let H.J. deal with that target? I'm afraid I'm lost
> when to ZERO_EXTEND addr (if needed at all), etc.
If you wish, I can take your patch and take if further. -mx32 is a
delicate beast...
Uros.
>
> Jakub