This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC PATCH, i386]: Prefer %ebx in set_got patterns


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]