Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 May 2001 01:35:15 +0200
From:      Erik Trulsson <ertr1013@student.uu.se>
To:        freebsd-stable@FreeBSD.ORG
Subject:   Re: CFLAGS Optimization
Message-ID:  <20010509013515.A2725@student.uu.se>
In-Reply-To: <KPECIILENDDLPCNIMLOFAEONCDAA.juha@saarinen.org>; from juha@saarinen.org on Wed, May 09, 2001 at 11:23:07AM %2B1200
References:  <200105082305.QAA04771@freeway.dcfinc.com> <KPECIILENDDLPCNIMLOFAEONCDAA.juha@saarinen.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, May 09, 2001 at 11:23:07AM +1200, Juha Saarinen wrote:
> :: Perhaps you'd be more comfortable if we changed the documentation to
> :: remove all references to any -O switch with a number attached?
> 
> Dunno. In my experience, any -O switch with a number attached creates
> problems when compiling the kernel/userland on FreeBSD, so it seems
> pointless to have those options. OTOH Jordan pointed out that there are some
> instances for which the optflags can be useful.

I have had both userland and kernel compiled using -O2 without noticing
any problems. On the other hand I didn't notice much of a performance
gain either so I decided that the extra compile time wasn't worth it.

I would say that most programs work just fine when compiled with
-O2/-O3 but not all and not all of the time.

Although I am sure there are bugs gcc's optimization code I think that
most of the time when programs work when compiled with -O but break
when compiler with -O2 this is actually due to bugs in the program that
only exposed when using high levels of optimization.


> 
> I don't know why the optflags produce broken code on FreeBSD, but not with
> Linux.

Are you sure it doesn't produce bad code on Linux? Anyway, it might be that
the bugs only trigger on certain code-sequences which occur in FreeBSD but
not in Linux. (Or maybe not.)

> 
> Aren't we sick of this thread yet?
> 

Yes, we are.

-- 
<Insert your favourite quote here.>
Erik Trulsson
ertr1013@student.uu.se


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?20010509013515.A2725>