From owner-freebsd-current Sat Feb 8 15:27:28 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5F5F737B401 for ; Sat, 8 Feb 2003 15:27:27 -0800 (PST) Received: from HAL9000.homeunix.com (12-233-57-224.client.attbi.com [12.233.57.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id A71B743FAF for ; Sat, 8 Feb 2003 15:27:26 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.6/8.12.5) with ESMTP id h18NROYP020533; Sat, 8 Feb 2003 15:27:24 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.6/8.12.5/Submit) id h18NROP8020532; Sat, 8 Feb 2003 15:27:24 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Date: Sat, 8 Feb 2003 15:27:24 -0800 From: David Schultz To: Ray Kohler Cc: freebsd-current@FreeBSD.ORG Subject: Re: Compiling with high optimization? Message-ID: <20030208232724.GA20435@HAL9000.homeunix.com> Mail-Followup-To: Ray Kohler , freebsd-current@FreeBSD.ORG References: <20030208173756.GA56030@arkadia.nv.cox.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030208173756.GA56030@arkadia.nv.cox.net> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Thus spake Ray Kohler : > Has anyone tried building world/kernel with high optimizations (-O2, > -O3) recently? What breaks? (Booby prize to whoever says "common sense" > ;) I last tried it quite a few months ago and the resolver died on me, > don't know what else. I'm not really thinking of running like that, but > I am curious about others' experiences. First, let me answer the question that you really meant to ask but forgot to, namely, ``How much of a performance difference does -O3 make over -O for the kernel/world?'' The answer is ``very little, for most purposes.'' So if you do use higher optimization levels, at least do a little benchmarking to make sure it was worth it. To answer your second question, higher optimization levels usually work, but there *will* be new bugs. I know of several libc problems due to -fstrict-aliasing, and I'm told that the inline assembly for TCP checksumming can still break. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message