This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC PATCH, i386]: Prefer %ebx in set_got patterns
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Vladimir Makarov <vmakarov at redhat dot com>, Evgeny Stupachenko <evstupac at gmail dot com>, Jakub Jelinek <jakub at redhat dot com>
- Date: Mon, 1 Dec 2014 18:54:18 +0100
- Subject: Re: [RFC PATCH, i386]: Prefer %ebx in set_got patterns
- Authentication-results: sourceware.org; auth=none
- References: <CAFULd4aPFSEy+m5mx73JLbmqaNpanfa2ravbCtuUsTNFpkO+Ow at mail dot gmail dot com> <547CA9BC dot 3030209 at redhat dot com>
On Mon, Dec 1, 2014 at 6:47 PM, Jeff Law <law@redhat.com> wrote:
> On 11/27/14 04:19, Uros Bizjak wrote:
>> Attached patch helps RA to choose the most appropriate PIC register by
>> changing the register preference for set_got patterns. Using this
>> patch, there should really be a reason for RA to avoid ABI mandated
>> hard PIC reg.
>
> Agreed.
>
>>
>> This patch avoids many mov %exx,%ebx in front of the calls, that
>> happen with unpatched compiler even with Vladimir's latest RA patch to
>> avoid duplicated PIC registers.
>
> [ ... ]
> Far more than I would have expected.
>
>
>> 2014-11-27 Uros Bizjak <ubizjak@gmail.com>
>>
>> * config/i386/i386.md (set_got): Use "=b,?r" constraint for operand
>> 0.
>> (set_got_labelled): Ditto.
>> (set_got_rex64): Ditto.
>> (set_rip_rex64): Ditto.
>> (set_got_offset_rex64): Ditto.
>>
>> Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.
>>
>> Thoughts?
>
> As HJ mentioned, it's not perfect, but it's certainly better than what we're
> doing now.
>
> The only thing I don't like is that it's really disguising failings in
> IRA/LRA.
Yes, this is the reason I have second thoughts about the patch. I
think that it papers over real issue in RA.
> Can you file a bug for that issue so that Vlad can track it.
Actually, I noticed it in libgo, where searching for various non-bx
thunks reveals many cases. I don't have a small testcase at hand ATM.
Uros.