This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR target/68937: i686: -fno-plt produces wrong code (maybe only with tailcall
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 17 Dec 2015 10:09:29 -0800
- Subject: Re: [PATCH] PR target/68937: i686: -fno-plt produces wrong code (maybe only with tailcall
- Authentication-results: sourceware.org; auth=none
- References: <20151216232951 dot GA17976 at intel dot com> <CAFULd4YMDKgyWQDiE5+e1WDCJad3tiyOztVAPb4TnktVdCvqUA at mail dot gmail dot com> <CAMe9rOqK2XWKzNJERP2YZTKYMSD7r5pbb3bqv4e146Gjro867Q at mail dot gmail dot com> <CAFULd4b2O=09RFYKp0C80yFx=W_yJXjJxU+a=WZGuzs3r3y+RQ at mail dot gmail dot com> <CAMe9rOocFnSi5Th1Gtko8Nq7zFUsm-+M0Leus5kt5RD=vO26og at mail dot gmail dot com> <CAMe9rOoLARSd6WPy_dr6JTJ+NPdrEW6eLhXZ77-UOuLSL1EcYw at mail dot gmail dot com>
On Thu, Dec 17, 2015 at 8:11 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Thu, Dec 17, 2015 at 7:50 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Thu, Dec 17, 2015 at 5:42 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
>>> On Thu, Dec 17, 2015 at 2:00 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>>>> On Thu, Dec 17, 2015 at 2:04 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
>>>>> On Thu, Dec 17, 2015 at 12:29 AM, H.J. Lu <hongjiu.lu@intel.com> wrote:
>>>>>> Since sibcall never returns, we can only use call-clobbered register
>>>>>> as GOT base. Otherwise, callee-saved register used as GOT base won't
>>>>>> be properly restored.
>>>>>>
>>>>>> Tested on x86-64 with -m32. OK for trunk?
>>>>>
>>>>> You don't have to add explicit clobber for members of "CLOBBERED_REGS"
>>>>> class, and register_no_elim_operand predicate should be used with "U"
>>>>> constraint. Also, please introduce new predicate, similar to how
>>>>> GOT_memory_operand is defined and handled.
>>>>>
>>>>
>>>> Here is the updated patch. There is a predicate already,
>>>> sibcall_memory_operand. It allows any registers to
>>>> be as GOT base, which is the root of our problem.
>>>> This patch removes GOT slot from it and handles
>>>> sibcall over GOT slot with *sibcall_GOT_32 and
>>>> *sibcall_value_GOT_32 patterns. Since I need to
>>>> expose constraints on GOT base register to RA,
>>>> I have to use 2 operands, GOT base and function
>>>> symbol, to describe sibcall over 32-bit GOT slot.
>>>
>>> Please use
>>>
>>> (mem:SI (plus:SI
>>> (match_operand:SI 0 "register_no_elim_operand" "U")
>>> (match_operand:SI 1 "GOT32_symbol_operand")))
>>> ...
>>>
>>> to avoid manual rebuild of the operand.
>>>
>>
>> Is this OK?
>>
>
> An updated patch to allow sibcall_memory_operand for RTL
> expansion. OK for trunk if there is no regression?
>
There is no regressions on x86-64 with -m32. OK for trunk?
--
H.J.