This is the mail archive of the gcc@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: Optimization of conditional access to globals: thread-unsafe?


Andi Kleen wrote:
Robert Dewar <dewar@adacore.com> writes:
a) the standard allows the optimization (or rather does not forbid it)

Assuming it is an optimization. See http://gcc.gnu.org/ml/gcc/2007-10/msg00607.html for a counter example. In general cache misses are so costly that anything that risks introducing more is in general a bad idea.

Sure, well nearly every optimization has some case where it is a pessimization (one interesting thing that happens is that if you
change the length of generated code in *any* way you may be unlucky
and cause a systematic instruction cache miss in a loop, inlining
can do this some times for example). But indeed, it is important
to evaluate a proposed optimization over a reasonable body of
tests, rather than going into the mode "look, I found this test
that speeds up 32.7% isn't that great? we definitely should put
this optimization in".



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