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: PATCH: PR target/66232: -fPIC -fno-plt -mx32 fails to generate indirect branch via GOT


On Thu, Dec 17, 2015 at 9:33 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Thu, Dec 17, 2015 at 8:49 AM, H.J. Lu <hongjiu.lu@intel.com> wrote:
>> Since Pmode is 64-bit with -maddress-mode=long for x32, indirect call
>> via GOT slot doesn't need zero_extend.  This patch limits *call_got_x32
>> and *call_value_got_x32 patterns to 32-bit Pmode, adds *call_got_x32_long
>> and *call_value_got_x32_long for 64-bit Pmode.
>>
>> OK for trunk if there is no regression?
>>
>>
>> H.J.
>> ---
>> gcc/
>>
>>         PR target/66232
>>         * config/i386/i386.md (*call_got_x32): Limited to 32-bit Pmode.
>>         (*call_value_got_x32): Likewise.
>>         (*call_got_x32_long): New pattern.
>>         (call_value_got_x32_long): Likewise.
>>
>
> Here is a different approach without adding new patterns.
> Either one works.

> gcc/
>
>     PR target/66232
>     * config/i386/constraints.md (Bs): Allow GOT slot for x32 with
>     64-bit Pmode.
>     (Bw): Likewise.
>     (Bz): Likewise.
>     * config/i386/predicates.md (call_insn_operand): Likewise.
>     (sibcall_insn_operand): Likewise.
>
> gcc/testsuite/
>
>     PR target/66232
>     * gcc.target/i386/pr66232-10.c: New test.
>     * gcc.target/i386/pr66232-11.c: Likewise.
>     * gcc.target/i386/pr66232-12.c: Likewise.
>     * gcc.target/i386/pr66232-13.c: Likewise.

This one is OK for mainlne

Thanks,
Uros.


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