On Wednesday 23 January 2008 12:35, you wrote: [...] > Why "unit at a time" compilation produced faster result ? But the code > was totally inlined and perhaps it optimised out something that it > should not have for this purpose.
This Whetstone Benchmark is not a good test. It is subjected to compiler optimization. Originaly with avr-gcc 4.1.2 the result was: ~2500 bytes of flash and ~30000 cycles. The reason was that compiler removes tests with math function: this functions are declared as 'const' and result is not used in external world. To avoid this omition I have add the calls of dummy external functions, so all operations are present. The 4.1.2 version is the best in both: size and speed: > >> 4030 88565 4.1.2 -Os > >> 5332 71751 4.1.2 -O3 But with avr-gcc 4.3-20080104 the result of '-O3' was strange: normal size, but too quick: 5494 31547 4.3 -O3 I do not study a reason. Possibly, it was any precalculation. I have try '-fno-unit-at-a-time' to avoid this optimization. After this: 5608 75351 Avr-libc was the same for all versions: CVS HEAD 2008-01-13. Regards, Dmitry. _______________________________________________ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list