This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Optimize manual byte swap implementations v3


Richard Sandiford wrote:

> Sorry to fan the flames, but... you seem to be suggesting that the
> optimisation shouldn't be on for either -O2 _or_ -O3.  I thought
> we were trying to move away from having -f optimisations that
> aren't enabled at any optimisation level?

That may be the opinion of some.

However, I think it's inevitable that we'll have optimizations that are
useful to some people in some circumstances, but that aren't
sufficiently beneficial to be enabled by default at any level.

Some things that are somewhere between code-generation options and
optimizations are certainly in that category; for example, something
like the proposed -fno-implicit-fp.  But, even pure optimizations might
well depend on the programmer making a promise about the code that goes
beyond what ISO C guarantees.  Or, they may just be beneficial for some
classes of programs but not others.

If we have an option which generates 50% faster code for some
substantial class of programs, it's probably a good thing to have it in
the compiler -- but if it makes many other programs 50% slower and slows
down compile time by 10%, I don't think we want it on by default.

> See e.g. what happened with -frtl-abstract-sequences.  It was
> reviewed in the normal way, and had its own testcases.  But because
> it doesn't get any coverage outside those testcases, it has slowly
> bitrotted to the point where it can hardly compile anything.

Without speaking to that particular optimization (which I don't know
much about), that kind of thing isn't really a counter-argument.  The
same can happen to any optional feature of the compiler.  It's up to the
people who care about it to maintain it.  Maybe in this particular case,
it should have been on by default, but that doesn't mean that all
optimizations should be.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]