Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Mar 2005 13:19:42 -0800
From:      Marcel Moolenaar <marcel@xcllnt.net>
To:        Scott Long <scottl@samsco.org>
Cc:        obrien@FreeBSD.org
Subject:   Re: cvs commit: src/sys/kern kern_sig.c
Message-ID:  <20050307211942.GA37106@ns1.xcllnt.net>
In-Reply-To: <422CBDEE.7020307@samsco.org>
References:  <200503021343.j22DhpQ3075008@repoman.freebsd.org> <200503020915.28512.jhb@FreeBSD.org> <4226446B.7020406@freebsd.org> <61ac46c154aa515a692308440dd1141d@FreeBSD.org> <422710DD.1070203@freebsd.org> <422719E0.10703@samsco.org> <20050307195156.GA18850@dragon.nuxi.com> <422CBDEE.7020307@samsco.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Mar 07, 2005 at 01:47:42PM -0700, Scott Long wrote:
> David O'Brien wrote:
> >On Thu, Mar 03, 2005 at 07:06:24AM -0700, Scott Long wrote:
> >
> >>a bit.  Also, there is talk about increasing the default kstack size due
> >>to all of the extra inlining that the compiler does with the -O2 option
> >
> >
> >I'd love more details on the extra inlining people are seeing with -O2.
> >(i.e. specifics)  -O2 is not supose to do extra function inlining.  That
> >is suppose to be a -O3 thing.
> >
> >From the GCC manual:
> >
> >-O3 Optimize yet more.
> >    -O3 turns on all optimizations specified by -O2 and also turns on the
> >    -finline-functions, -fweb and -frename-registers options.
> >
> >-O2 Optimize even more.
> >    GCC performs nearly all supported optimizations that do not involve a
> >    space-speed tradeoff. The compiler does not perform loop unrolling or
> >    function inlining when you specify -O2. As compared to -O, this
> >    option increases both compilation time and the performance of the
> >    generated code.
> >    ..snip..
> >
> >The -O2 options that affect size are:
> >    -falign-functions  -falign-jumps  -falign-loops -falign-labels
> >    -freorder-blocks -fprefetch-loop-arrays
> 
> Talk to Bill Paul about the massive amount of inlining that is happening
> in the ieee80211 ioctl code, and the no_inline directives he had to use
> to kludge around it.

gcc(1) does inlining of functions labeled with inline at -O1.
Functions not labeled with inline will be inlined at -O2.
Both cases are subject to preconditions (i.e. complexity of
the function being inlined).

In other words: the gcc(1) manual is inaccurate.

-- 
 Marcel Moolenaar	  USPA: A-39004		 marcel@xcllnt.net



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