On Mon, 25 May 2009, Szak�ts Viktor wrote: > Thanks. What should we do in default builds? Can we safely > pacify the warnings while keeping performance? Should we just > safely suppress these warnings?
I'm afraid that at least in few places GCC can strip out some of our code or at least change the order of some instructions and wrong binaries will be created. It has to be fixed. Please note that number of optimizations which use strict aliasing is systematically growing up so even if I pacify the warnings for GCC4.4 it's possible that it won't help in GCC4.5 or newer. So the only one clean solution is using code which operates on bytes to create more complex numbers. It looks more complicated but does not have to be much slower. It's even possible that it will be faster then direct access with forced casting in some modern CPUs. Some new CPUs which seems to work with wrong alignment also generate exception when some complex numbers are read from memory address with wrong alignment but default exception handler tries to complete the operation using byte access. In such case explicit byte access should be noticeable faster. BTW have you tried to compare speedtst results for Harbour compiled with and without HB_STRICT_ALIGNMENT macro? The comparison should be done for -gc2 output. In -gc3 PCODE is generated only for codeblocks. best regards, Przemek _______________________________________________ Harbour mailing list [email protected] http://lists.harbour-project.org/mailman/listinfo/harbour
