On Tue, Nov 04, 2003 at 04:20:41PM +0800, Zhang Weiwu wrote:
> Hello. I'm running 5.1-RELEASE.
> I read the gcc man page. It is not clear what -O implys. Is -O equal to 
> -O1 or -O2? If I wish to optimize making does it make sense to add 
> CFLAGS=-O2 in the make.conf(5)?

-O is the same as -O1

Ah -- the shibboleth of cranking up the optimisation level to make
things run *really fast*.  First of all, for general purpose code, -O
gets you most of the available optimisation benefits without causing
any problems.  You can try CFLAGS=-O2 in /etc/make.conf if you like,
and most things will work OK but by no means all: some code will not
compile correctly under high optimization levels.  The immediate
response if you report this sort of thing as a bug will be to see if
the problem is repeatable using a lower optimisation level.

Secondly, you will achieve a much greater performance improvement by
setting the CPUTYPE variable appropriately.



Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to