David D.W. Downey david.downey at codecastle.com
Tue Sep 5 00:35:34 PDT 2000

On Tue, 5 Sep 2000, Hendrik Volker Brunn wrote:

> On Mon, Sep 04, 2000 at 05:13:09PM -0400, Chris Gianelloni wrote:
> > The main problem I have is that I am not familiar with exactly *what* may be causing the problem.  I was more or less asking if there are any
> > packages that anyone KNOWS offhand doesn't work at such high optimisations.  I am really wanting everything possible to be optimised.  Is it
> > possible to use optimisations when compiling glibc or should I compile it with the default -O2 (maybe -O3)
> I still wonder why people are trying to achieve "highest optimisation".
> There is nearly no measurable improvement, and specifically none that's
> worth the hassle. I don't know about pgcc, but gcc doesn't support
> optimizations higher than -O3 so if you specified -O6 it'd fallback to
> -O3. And that's the point I wanted to get to - it is not recommended nor
> supported to compile glibc with more than -O2. And I wouldn't recommend it
> for binutils, too. I for myself don't use optimisations above -O2 and I
> feel fine with it. None of the packages here fails, so why should I risk
> losing hair for somehting that i can't measure?

Well, I've kept my mouth shut over this thread for most of it, but I do
feel the need to say something in response to this. 
Depending on the end use of an application, you are correct that
optimization is probably not all that effective if it's just going to be a
home system doing nothing more than being an IRC machine. But
optimizations do have their place. Case in point, KiXO Linux (my
LFS-started distribution) does require heavy optimization levels due to
it's mission critical role it's slated to fulfil in the Enterprize
Clustering Solution market. Any optimization in functionality is a major

Now, you state that -O6 does nothing more than -O3 optimization levels
do. This is not true. While -O3 does also do jump unrolling and switch
optimizations, -O6 does in fact have it's own level other than a return to
-O3 optimizations. -O6 also looks to see what actual machine code entries
will perforn the same job as other possible entries (we're talking extreme
machine level here) but will actually execute faster than another
choice. -O3 does not do that. This is an inportant optimization where
speed of execution is critical. While you are correct that milliseconds in
machine time are not noticiable to humans, it DOES make a difference in
the long run on how many executions of a certain function I can perform
over time. Sometimes even 600 extra "product life" executions mean a
couple thousand dollars of income.

> Answering your above question: Ever thought of switching off optimisations
> for the failing packages? RTB!

hvb, I do have to agree with him on this part. There are some products
that do not like optimizations. One I've found that breaks under high
optimizations is shadow passwording. (It tends to make userdel and adduser
eitehr not correctly create user dirs and such or it segfaults the
apps) (Yes, I've checke, it's not the configuration that is broken it
stems from the optimization levels used)

> hvb - fight back useless timeconsuming packagebreaking nervedestroying
> optimisation!
Agreed... when they are timeconsuming and application breaking.. they
aren't needed.

> If you still want to use optimisation - I recommend you do your own
> research on *what* is optimized at all - if you understand these things
> start calculating, if the microseconds saved on execution are worth
> spending days to weeks for compiling. But please don't use optimization
> without knowing what it is or what it achieves.

The GCC (EGCS) docs are quite good on providing this information. An
excellent read for those that really want to pull the speed out of their
apps while keeping an eye on what that could potentially break.

> Sorry for this guys, but I had to say this one time, I will not comment on
> opt****** any further. 8-)

Same here. :-)

David D.W. Downey          Red Hat Certified Engineer   |   Internet Security Specialist            
KiXO Linux Creator         http://www.KiXOLinux.com | http://sourceforge.net/projects/kixolinux/
HAGISS Project Leader      http://www.sourceforge.net/projects/HAGISS/ (part of KiXO Linux)
Member OSWG, LPI           http://www.owsg.org   |   http://www.lpi.org    
  "A good supervisor can step on your toes without messing up your shine!" (fortune-mod quote)

More information about the lfs-dev mailing list