Skip site navigation (1)Skip section navigation (2)
Date:      08 Mar 2001 15:24:24 -0500
From:      Randell Jesup <rjesup@wgate.com>
To:        Matt Dillon <dillon@earth.backplane.com>
Cc:        Glen Gross <ggross@symark.com>, Steven Farmer <steve@megahack.com>, "freebsd-stable@FreeBSD.ORG" <freebsd-stable@FreeBSD.ORG>, msinz@wgate.com (Mike Sinz)
Subject:   Re: ARCH flag in new make.conf
Message-ID:  <ybud7bsm2kn.fsf@jesup.eng.tvol.net.jesup.eng.tvol.net>
In-Reply-To: Matt Dillon's message of "Wed, 7 Mar 2001 10:56:59 -0800 (PST)"
References:  <01C0A6F1.C26E6DC0.ggross@symark.com> <200103071856.f27Iuxl71513@earth.backplane.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Matt Dillon <dillon@earth.backplane.com> writes:
>    I think you are being entirely sensible.   I used to use -O2 all the time,
>    but as of about a year ago it started breaking things (starting with
>    the FreeBSD kernel).  Then I started using -Os because I like the code
>    compaction it produced, but that started breaking the kernel too.  Now I
>    just use -O (and -O had damn well better continue to work because my
>    static inlines will not compile properly without it!).

        Two possibilities (of course):
1) gcc2.95.2 (which you're using I assume) has some bugs at -O2 (or -Os)
   level which are breaking on some kernel code; or
2) some code in the kernel is inherently unsafe because of lack of
   'volatile' statements or other locking/synchronization issues.

(ok, 3: both of the above)

>    Now I just don't care any more, except for the 0.1% of my personal code
>    that I need to optimize, and most of that I optimize simply by playing
>    around with the C a little or changing an algorithm out or something like
>    that.

        I care; I'm sure others do.  We use -O2 (and even -O3) in
production code.  The fact that -O2 breaks the kernel waves big, red, scary
flags.  Whether it's the kernel or gcc, it needs to be fixed.  The kernel
isn't the only code that uses gcc or -O2, and if the kernel has bugs in it
I want to track them down.  The fact that it started breaking a year ago
implies either a new gcc was added (I don't think so around then, but I
wasn't paying attention), some bugs were checked into the kernel
(possible), or some code was checked in that was correct but broke the
compiler.  If we knew when the breakage happened it's far easier to track
down....

        At this rate, pretty soon we'll be requiring -g to compile the
kernel... ;-)

-- 
Randell Jesup, Worldgate Communications, ex-Scala, ex-Amiga OS team ('88-94)
rjesup@wgate.com


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




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