This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Reduce fpic related slowdowns
Robert Wohlrab <robert.wohlrab@gmx.de> writes:
> Ian Lance Taylor wrote:
>> There is always a penalty for using -fPIC, because the code must be
>> position independent. The usual penalty I've measured is more like 2
>> to 3%. A 5% penalty seems a trifle high, but certainly possible if
>> your code uses a lot of global variables.
>>
>> It sounds like you have specific examples where the code is worse. If
>> you post them we may be able to tell you whether it is possible to do
>> better.
> It can be found at http://bitbucket.org/richard42/mupen64plus-core/ but isn't
> yet production ready due to the architectural changes.
I was thinking more in terms of a small (10 to 50 lines) complete test
case and the generated assembly code with and without -fPIC. That is,
I didn't mean a large body of code which could take hours or days to
analyze, I meant a specific example. Sorry for being misleading.
Ian