This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Enable EBX for x86 in 32bits PIC code
- From: Ilya Enkovich <enkovich dot gnu at gmail dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, Vladimir Makarov <vmakarov at redhat dot com>, gcc at gnu dot org, gcc-patches <gcc-patches at gcc dot gnu dot org>, Evgeny Stupachenko <evstupac at gmail dot com>, Richard Biener <richard dot guenther at gmail dot com>, Uros Bizjak <ubizjak at gmail dot com>, Petr Machata <pmachata at redhat dot com>
- Date: Wed, 24 Sep 2014 10:56:44 +0400
- Subject: Re: Enable EBX for x86 in 32bits PIC code
- Authentication-results: sourceware.org; auth=none
- References: <CAMbmDYacBWjKtCYPB0A2m=fkUTk_Wt5D6f2aEkH7C3paWaR7ag at mail dot gmail dot com> <53FCA6F5 dot 7020405 at redhat dot com> <20140826213712 dot GA39451 at msticlxl57 dot ims dot intel dot com> <53FE3D46 dot 8050904 at redhat dot com> <CAMbmDYZxt7wceND52mb9rM+poTNpjFtLyj2WT5qatbjMdLWmbg at mail dot gmail dot com> <CAMbmDYb9E6-DpCd8cx+X-4d3oDkLMTo63ibojAY+Lsf9L-UNRA at mail dot gmail dot com> <540777C0 dot 9050106 at redhat dot com> <20140923135437 dot GD35262 at msticlxl57 dot ims dot intel dot com> <20140923143419 dot GN17454 at tucnak dot redhat dot com> <54219900 dot 6060903 at redhat dot com> <20140923160302 dot GR17454 at tucnak dot redhat dot com> <54219B76 dot 3080607 at redhat dot com>
2014-09-23 20:10 GMT+04:00 Jeff Law <law@redhat.com>:
> On 09/23/14 10:03, Jakub Jelinek wrote:
>>
>> On Tue, Sep 23, 2014 at 10:00:00AM -0600, Jeff Law wrote:
>>>
>>> On 09/23/14 08:34, Jakub Jelinek wrote:
>>>>
>>>> On Tue, Sep 23, 2014 at 05:54:37PM +0400, Ilya Enkovich wrote:
>>>>>
>>>>> use fixed EBX at least until we make sure pseudo PIC doesn't harm debug
>>>>> info generation. If we have such option then gcc.target/i386/pic-1.c
>>>>> and
>>>>
>>>>
>>>> For debug info, it seems you are already handling this in
>>>> delegitimize_address target hook, I'd suggest just building some very
>>>> large
>>>> shared library at -O2 -g -fpic on i?86 and either look at the
>>>> sizes of .debug_info/.debug_loc sections with/without the patch,
>>>> or use the locstat utility from elfutils (talk to Petr Machata if
>>>> needed).
>>>
>>> Can't hurt, but I really don't see how changing from a fixed to an
>>> allocatable register is going to muck up debug info in any significant
>>> way.
>>
>>
>> What matters is if the delegitimize_address target hook is as efficient in
>> delegitimization as before. E.g. if it previously matched only when
>> seeing
>> %ebx + gotoff or similar, and wouldn't match anything now, some vars could
>> have debug locations including UNSPEC and be dropped on the floor.
>
> Ah, yea, that makes sense.
>
> jeff
After register allocation we have no idea where GOT address is and
therefore delegitimize_address target hook becomes less efficient and
cannot remove UNSPECs. That's what I see now when build GCC with patch
applied:
../../../../gcc/libgfortran/generated/sum_r4.c: In function 'msum_r4':
../../../../gcc/libgfortran/generated/sum_r4.c:195:1: note:
non-delegitimized UNSPEC UNSPEC_GOTOFF (1) found in variable location
msum_r4 (gfc_array_r4 * const restrict retarray,
^
../../../../gcc/libgfortran/generated/sum_r4.c:195:1: note:
non-delegitimized UNSPEC UNSPEC_GOTOFF (1) found in variable location
../../../../gcc/libgfortran/generated/sum_r4.c:195:1: note:
non-delegitimized UNSPEC UNSPEC_GOTOFF (1) found in variable location
../../../../gcc/libgfortran/generated/sum_r4.c:195:1: note:
non-delegitimized UNSPEC UNSPEC_GOTOFF (1) found in variable location
../../../../gcc/libgfortran/generated/sum_r8.c: In function 'msum_r8':
../../../../gcc/libgfortran/generated/sum_r8.c:195:1: note:
non-delegitimized UNSPEC UNSPEC_GOTOFF (1) found in variable location
msum_r8 (gfc_array_r8 * const restrict retarray,
^
../../../../gcc/libgfortran/generated/sum_r8.c:195:1: note:
non-delegitimized UNSPEC UNSPEC_GOTOFF (1) found in variable location
../../../../gcc/libgfortran/generated/sum_r8.c:195:1: note:
non-delegitimized UNSPEC UNSPEC_GOTOFF (1) found in variable location
../../../../gcc/libgfortran/generated/sum_r8.c:195:1: note:
non-delegitimized UNSPEC UNSPEC_GOTOFF (1) found in variable location
Ilya