From owner-cvs-all@FreeBSD.ORG Tue Jul 22 12:13:45 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CBBC437B401; Tue, 22 Jul 2003 12:13:45 -0700 (PDT) Received: from mx0.freebsd-services.com (survey.codeburst.net [195.149.39.161]) by mx1.FreeBSD.org (Postfix) with ESMTP id D1D7E43FB1; Tue, 22 Jul 2003 12:13:44 -0700 (PDT) (envelope-from paul@freebsd-services.com) Received: by mx0.freebsd-services.com (Postfix, from userid 1002) id C6F5E1B211; Tue, 22 Jul 2003 20:13:43 +0100 (BST) Date: Tue, 22 Jul 2003 20:13:43 +0100 From: Paul Richards To: Poul-Henning Kamp Message-ID: <20030722191343.GB90991@survey.codeburst.net> References: <20030722163007.GA6080@HAL9000.homeunix.com> <13094.1058892140@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <13094.1058892140@critter.freebsd.dk> User-Agent: Mutt/1.5.4i cc: cvs-src@FreeBSD.ORG cc: David Schultz cc: src-committers@FreeBSD.ORG cc: cvs-all@FreeBSD.ORG cc: Bruce Evans Subject: Re: cvs commit: src/sys/dev/lnc if_lnc.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2003 19:13:46 -0000 On Tue, Jul 22, 2003 at 06:42:20PM +0200, Poul-Henning Kamp wrote: > In message <20030722163007.GA6080@HAL9000.homeunix.com>, David Schultz writes: > > >The cost of not inlining is insignificant on i386, but it can be > >very significant on architectures with sliding register windows, > >such as sparc64. On sparc64, a trap is taken every time the > >procedure call depth changes by more than 6. An inlining can mean > >the difference between super-efficient procedure calls and having > >to slide the register window back and forth at great penalty. > > Fine, but if you are not able to measure the difference and the > code is bigger, is it worth it ? Though in the case of if_lnc the code was not bigger. There was no downside to the use of inline in this case and you've changed perfectly valid code just to shut up gcc. A lot of gcc warnings are worth having on by default because they catch a lot of potential bugs. With those the few cases where it's deliberate are worth working around to shut up the warning so they can be left on by default for the rest of the tree. I don't think inline is one of those checks though, since there are perfectly good reasons to use it sometimes that gcc doesn't like. I don't think it should be a default warning therefore, perhaps the "policy" should be to run your code through with it on so you get warned about potential abuses and then make your own judgement and not be a slave to the compiler in this case. -- Tis a wise thing to know what is wanted, wiser still to know when it has been achieved and wisest of all to know when it is unachievable for then striving is folly. [Magician]