From owner-freebsd-hackers Sun Apr 9 2: 3: 1 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [203.2.75.105]) by hub.freebsd.org (Postfix) with ESMTP id 24A6037B69C for ; Sun, 9 Apr 2000 02:02:56 -0700 (PDT) (envelope-from diskiller@borg-cube.com) Received: from bender (adlax1-094.dialup.optusnet.com.au [198.142.51.94]) by mail02.syd.optusnet.com.au (8.9.3/8.9.3) with ESMTP id TAA14264 for ; Sun, 9 Apr 2000 19:02:51 +1000 Date: Sun, 9 Apr 2000 18:32:20 +0930 (CST) From: Martin Minkus X-Sender: diskiller@bender.on.diskiller.net To: freebsd-hackers@freebsd.org Subject: Re: What are the best gcc optimization options for Pentium 200 MMX In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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