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


Mark Mitchell wrote:
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.

I would say that such a transformation is not an optimization, unless the source contains some indication that it follows this guarantee, and if possible the compiler checks that this is the case. For example in Ada, we can have optimizations that depend on the presence of a specific pragma Restriction, or other specialized pragma.


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