This is the mail archive of the
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: Vladimir Makarov <vmakarov at redhat dot com>
- Cc: 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>, Jeff Law <law at redhat dot com>
- Date: Thu, 28 Aug 2014 12:28:18 +0400
- Subject: Re: Enable EBX for x86 in 32bits PIC code
- Authentication-results: sourceware.org; auth=none
- References: <CAOvf_xxsQ_oYGqNAVQ1+BW+CuD3mzebZ2xma0jpF=WfyZMCRCA at mail dot gmail dot com> <CAFiYyc1mFtTezkTJORmJJq+yht=qPSwiN7KDn19+bSuSdaqvMQ at mail dot gmail dot com> <CAOvf_xyeVeg2oB9Xxz8RMEQ6gyfJY5whd9s4ygoAAEaMU9efnA at mail dot gmail dot com> <20140707114750 dot GB31640 at tucnak dot redhat dot com> <CAMbmDYZV_fx0jxmKHhLsC2pJ7pDzuu6toEAH72izOdpq6KGyfg at mail dot gmail dot com> <20140822121151 dot GA60032 at msticlxl57 dot ims dot intel dot com> <53FB5184 dot 3030500 at redhat dot com> <CAMbmDYbP77pmkqpJD8cnXbe7_8aRMnYF-tnfKRubULn8-aDCdw at mail dot gmail dot com> <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>
2014-08-28 0:19 GMT+04:00 Vladimir Makarov <email@example.com>:
> On 2014-08-26 5:42 PM, Ilya Enkovich wrote:
>> Here is a patch I tried. I apply it over revision 214215. Unfortunately
>> I do not have a small reproducer but the problem can be easily reproduced on
>> SPEC2000 benchmark 175.vpr. The problem is in read_arch.c:701 where float
>> value is compared with float constant 1.0. It is inlined into read_arch
>> function and can be easily found in RTL dump of function read_arch as a
>> float comparison with 1.0 after the first call to strtod function.
>> Here is a compilation string I use:
>> gcc -m32 -mno-movbe -g3 -fdump-rtl-all-details -O2 -ffast-math
>> -mfpmath=sse -m32 -march=slm -fPIE -pie -c -o read_arch.o
>> -DSPEC_CPU2000 read_arch.c
>> In my final assembler comparison with 1.0 looks like:
>> comiss .LC11@GOTOFF(%ebp), %xmm0 # 1101 *cmpisf_sse [length =
>> and %ebp here doesn't have a proper value.
>> I'll try to make a smaller reproducer if these instructions don't help.
> I've managed to reproduce it. Although it would be better to send the patch
> as an attachment.
> The problem is actually in IRA not LRA. IRA splits pseudo used for PIC.
> Then in a region when a *new* pseudo used as PIC we rematerialize a constant
> which transformed in memory addressed through *original* PIC pseudo.
> To solve the problem we should prevent such splitting and guarantee that PIC
> pseudo allocnos in different region gets the same hard reg.
> The following patch should solve the problem.
Thanks for the patch! I'll try it and be back with results.