This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: has the linker an impact on performance of generated code?


> Hello,
> 	the question is simple: is that possible that in between all the
> possible combinations of compilers (egcs 1.1b gcc 2.7.2.3) switches (-O1
> -O2 -O3) and linkers the best solution as far as performance of
> generated code is concerned is the following:
> 
> egcs -c -O1 -fomit-frame-pointer prime.c

You could also try -Os -fomit-frame-pointer .

> gcc-2.7 -s -lm prime.o

This will link the the libraries for gcc-2.7 .  In particular, the long long
remainder / divide is a library function.
If you hand-code these functions carefully in assembler and link in these
versions, this will probably get you better performance.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]