This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: PR target/66232: -fPIC -fno-plt -mx32 fails to generate indirect branch via GOT
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 22 Dec 2015 16:55:18 +0100
- Subject: Re: PATCH: PR target/66232: -fPIC -fno-plt -mx32 fails to generate indirect branch via GOT
- Authentication-results: sourceware.org; auth=none
- References: <20151217164950 dot GA24079 at intel dot com> <CAMe9rOpyOJO5LOKVE0kbQT9bUJmSAxi1y0N1VUByUrrCi8uazw at mail dot gmail dot com>
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.