cvs commit: src/sys/dev/lnc if_lnc.c

Paul Richards paul at freebsd-services.com
Tue Jul 22 12:13:46 PDT 2003


On Tue, Jul 22, 2003 at 06:42:20PM +0200, Poul-Henning Kamp wrote:
> In message <20030722163007.GA6080 at 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]


More information about the cvs-src mailing list