"Boyd Stephen Smith Jr." <[EMAIL PROTECTED]> posted
[EMAIL PROTECTED], excerpted below, on  Thu, 28 Sep
2006 14:52:40 -0500:

> If the code does not conform to the standard, the output of the compiler
> is undefined.  In particular, it is acceptable for the compiler produce
> errors or produce a binary that crashes.  The fault is with the code.
> 
> If the code does conform to the standard, the behavior of the output of
> the compiler is specified.  In particular, subject to resource limitations
> and hardware failure, the compile job must succeed and produce a binary
> that, again subject to resources and hardware, does not crash and performs
> the operations described in the source code.  The fault is with the
> compiler.

See, that's the problem, we don't live in a perfect world, and neither the
code nor the compiler are faultless.  Additionally, it's well known that
gcc is getting stricter (insisting the code hew closer to that standard
you mentioned), so stuff that once worked fine now doesn't, and fancy new
optimizations that cause code that again once worked fine to fail continue
to appear.  Since -O2 on a specific arch, with no further optimizations,
tends to be the most commonly tested, and few if any "new" optimizations
get invoked by it without at least a minor version span's testing first,
that's the most solid choice for those who prefer to let others deal with
all the "surprises".

Fortunately, some of us like the challenge of surprises, however, and run
these new optimizations, or it'd no longer be possible to widely test them
and get the worst kinks worked out of both the code and the compiler
optimizations before they could eventually be added to -O2 (or
-O<whatever> as appropriate).  There's nothing wrong with that, as long
as one realizes the risks involved and is willing to put in the work
necessary to overcome the obstacles when they popup.

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman

-- 
[email protected] mailing list

Reply via email to