This is the mail archive of the
mailing list for the GCC project.
Re: Enable EBX for x86 in 32bits PIC code
- From: Jeff Law <law at redhat dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>, Ilya Enkovich <enkovich dot gnu at gmail dot com>
- Cc: 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>
- Date: Tue, 23 Sep 2014 09:59:07 -0600
- Subject: Re: Enable EBX for x86 in 32bits PIC code
- Authentication-results: sourceware.org; auth=none
- References: <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> <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> <CAFULd4ZBW=KtB94cpVT9uY0gF4visYXdxRh0Hs_ZJLUuB3Zd+w at mail dot gmail dot com>
On 09/23/14 08:23, Uros Bizjak wrote:
Agreed. Continuing to support both modes just seems like a maintenance
nightmare and asking for problems at some point. If there's performance
regressions, we just tackle them :-)
On Tue, Sep 23, 2014 at 3:54 PM, Ilya Enkovich <email@example.com> wrote:
Here is a patch which combines results of my and Vladimir's work on EBX enabling.
It works OK for SPEC2000 and SPEC2006 on -Ofast + LTO. It passes bootstrap but there are few new failures in make check.
gcc.target/i386/pic-1.c fails because it doesn't expect we can use EBX in 32bit PIC mode
gcc.target/i386/pr55458.c fails due to the same reason
gcc.target/i386/pr23098.c fails because compiler fails to use float constant as an immediate and loads it from GOT instead
Do we have the final decision about having a sompiler flag to control enabling of pseudo PIC register? I think we should have a possibility to 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 gcc.target/i386/pr55458.c should be modified, otherwise these tests should be removed.
I think having this flag would be dangerous. In effect, this flag
would be a hidden -ffixed-bx, with unwanted consequences on asm code
that handles ebx. As an example, please see config/i386/cpuid.h - ATM,
we handle ebx in a special way when __PIC__ is defined. With your
patch, we will have to handle it in a special way when new flag is in
effect, which is impossible, unless another compiler-generated define
So, I vote to change PIC reg to a pseudo unconditionally and adjust
testsuite for all (expected) fall-out.
I suspect any performance regressions we find are going to point us at
issues in IRA/LRA that we would want to look at anyway.