From owner-freebsd-questions@FreeBSD.ORG Tue Nov 4 00:59:10 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1390716A4CE for ; Tue, 4 Nov 2003 00:59:10 -0800 (PST) Received: from mailout.informatik.tu-muenchen.de (mailout.informatik.tu-muenchen.de [131.159.0.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 327AD43FA3 for ; Tue, 4 Nov 2003 00:59:09 -0800 (PST) (envelope-from barner@in.tum.de) Received: by zi025.glhnet.mhn.de (Postfix, from userid 1000) id CE9A271A; Tue, 4 Nov 2003 09:59:07 +0100 (CET) Date: Tue, 4 Nov 2003 09:59:07 +0100 From: Simon Barner To: Zhang Weiwu Message-ID: <20031104085907.GA90790@zi025.glhnet.mhn.de> References: <3FA76159.6010807@hotmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/9DWx/yDrRhgMJTb" Content-Disposition: inline In-Reply-To: <3FA76159.6010807@hotmail.com> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at informatik.tu-muenchen.de cc: freebsd-questions@freebsd.org Subject: Re: optimize with -O2 or -O? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2003 08:59:10 -0000 --/9DWx/yDrRhgMJTb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > I read the gcc man page. It is not clear what -O implys. Is -O equal to= =20 > -O1 or -O2? If I wish to optimize making does it make sense to add=20 > CFLAGS=3D-O2 in the make.conf(5)? Hi, -O =3D=3D -O1 (see `info gcc' -> Invoking GCC -> Optimize Options) It is recommended not to use anything higher than -O since GCC is known to procduce broken code on higher optimization levels. Depending on what gcc version you are using, also specifing CPUTYPE=3D... in /etc/make.conf might bring you troubles (for certain CPUs, e.g.=20 athlon IIRC). Post the output of `gcc --version' and people will be able to tell you. What you could try is to use -O2 for some selected ports, but the question is whether you will see a measurable performance gain. Some ports that are known to build alright at -O2 (e.g. mplayer) have WITH_OPTIMIZED_CFLAGS knob. Regards, Simon --/9DWx/yDrRhgMJTb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/p2pbCkn+/eutqCoRAsswAKCghQRUts4BuYaD4jlUKQay6+KS+wCg312h wXzlZYVDduBGi8MccemCL3M= =K7Ud -----END PGP SIGNATURE----- --/9DWx/yDrRhgMJTb--