Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Apr 2000 18:32:20 +0930 (CST)
From:      Martin Minkus <diskiller@borg-cube.com>
To:        freebsd-hackers@freebsd.org
Subject:   Re: What are the best gcc optimization options for Pentium 200 MMX
Message-ID:  <Pine.BSF.4.21.0004091825230.44473-100000@bender.on.diskiller.net>
In-Reply-To: <Pine.GSO.4.21.0004082211040.22448-100000@rac10.wam.umd.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
A very quick example of why big -O3 gcc optimizations are a bad thing?

my /etc/make.conf has

USA_RESIDENT=NO
CFLAGS=-O3 -pipe -mcpu=pentiumpro -march=pentiumpro -fomit-frame-pointer
NOPROFILE=true

(NOPROFILE=true because profiled libraries fail to build with no frame pointer)

now, cd /usr/ports/net/kicq; make install

bender:~> kicq
Segmentation fault(core dumped)
bender:~>

kicq is broken, and segfaults. Infact it dumps core with a problem in the
QT library with QString::find(). But why? due to -O3 optimizations, kicq
does something stupid and passes an invalid value/pointer to a QString
causing it to dump core. I haven't bothered to go into this in detail
(compiling kicq AND qt with -g to see whats happening). Why bother ?

No optimizations fixes this.

Mind you, there are a few other ports that are like this also, it appears
to be a bug with gcc 2.96.2's C++ compiler. It was always fine in gcc
2.7.2.

Make world runs perfectly with my -O3 and -mcpu=pentiumpro optimizations,
however. Its just a few ports that happen to be in C++. So gcc definately
has problems there.

Hopefully this will show why you should be real cautious, and the second
you have problems with a program dumping core recompile WITHOUT
optmizations, or ONLY use -O, no higher.

--
Martin Minkus aka DiSKiLLeR
Email: diskiller@borg-cube.com   Web: http://www.diskiller.net

I live in a world of paradox... my willingness to destroy is
your chance for improvement, my hate is your faith, my failure
is your victory - a victory that won't last.



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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0004091825230.44473-100000>