has the linker an impact on performance of generated code?

Joern Rennecke amylaar@cygnus.co.uk
Tue Sep 29 10:10:00 GMT 1998

> Hello,
> 	the question is simple: is that possible that in between all the
> possible combinations of compilers (egcs 1.1b gcc 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.

More information about the Gcc mailing list