Oliver Fromme <[EMAIL PROTECTED]> writes:

> The gcc optimizer is traditionally buggy.  I wouldn't trust a
> system compiled with anything more than -O (especially on
> production servers).  The higher optimization levels don't
> provide much of a speed improvement anyway, sometimes they make
> the code even slower.  YMMV.

This is a somewhat religious issue.  There is no absolutely safe
optimization level, and recommendations needn't remain constant,
especially as the compiler changes.

There are known problems that break code when compiling with -O.  I
know at least one case that breaks with -O or -O2 but works with -O3
(this applies to both pre-egcs and egcs compilers).  When things will
break is very unpredictable.

In my experience, -O2 rarely causes additional breakage compared to -O
in correct code.  In egcs >= 1.1 and gcc >= 2.95, -O2 includes new
optimizations that can improve performance quite significantly.

Sometimes breakage can also be caused by incorrect code that is only
exposed by the optimization.

You really shouldn't generalize too much.  All you can correctly state
is that software package X seems to work well with gcc/egcs version Y
at optimization level Z.  You can also state that some gcc/egcs
version has known bugs at some optimization level (however, all
reasonably current versions have known bugs at *all* optimization
levels).



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to