Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Jul 2003 20:13:43 +0100
From:      Paul Richards <paul@freebsd-services.com>
To:        Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc:        Bruce Evans <bde@zeta.org.au>
Subject:   Re: cvs commit: src/sys/dev/lnc if_lnc.c
Message-ID:  <20030722191343.GB90991@survey.codeburst.net>
In-Reply-To: <13094.1058892140@critter.freebsd.dk>
References:  <20030722163007.GA6080@HAL9000.homeunix.com> <13094.1058892140@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
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]



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030722191343.GB90991>