Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Jul 2003 14:53:26 -0400 (EDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/dev/rp rp.c
Message-ID:  <XFMail.20030723145326.jhb@FreeBSD.org>
In-Reply-To: <24542.1058985134@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help

On 23-Jul-2003 Poul-Henning Kamp wrote:
> In message <XFMail.20030723142400.jhb@FreeBSD.org>, John Baldwin writes:
>>
>>On 23-Jul-2003 Poul-Henning Kamp wrote:
>>> phk         2003/07/23 11:03:23 PDT
>>> 
>>>   FreeBSD src repository
>>> 
>>>   Modified files:
>>>     sys/dev/rp           rp.c 
>>>   Log:
>>>   Undo single-intance inlining which is way above the comfort limit for GCC.
>>
>>Single instance inlining can not hurt.  It can help by reducing call
>>stack depth and code size however.  I thought you were for reducing code
>>size, not increasing it.  Please use __always_inline to shut up gcc
>>instead of de-inlining for single instance inlines.
> 
> Please provide data showing actual improvement for inlining.

   text    data     bss     dec     hex filename
  23554     440    1088   25082    61fa rp.o.both
  23421     440    1088   24949    6175 rp.o.non
  23394     440    1088   24922    615a rp.o.recv

Inlining both is worse than inlining neither, but inlining just
rp_do_receive() saves a whopping 27 bytes.  Even inlining both
is just a difference of 133 bytes or almost 0.5% of the code.

> If I changed this to __always_inline, I would change the code generated,
> to start inlining these functions.  We don't know the effect of that.

Bull.  We've been inlining these functions in 4.x and the like for quite
some time since if I'm reading things correctly gcc didn't start to refuse
inlining until gcc 3.x.

> Instead I preserve the status quo by removing the inline request which
> GCC ignores.

No, you are just setting the results of a gcc bug in stone.  In FreeBSD
< 5.0 the status quo is to inline, and there are a lot more of those
releases than 5.0 and 5.1.

-- 

John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/



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