Using the GCC compiler for ARM (windows) :
arm-none-eabi-gcc.exe (Sourcery CodeBench Lite 2012.09-63) 4.7.2 version
I have got different object file produced every ~5 times i compiled the same source file.
The optimization level 3 is used (aggressive) is used, compiler options used:
-O3 -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fshort-wchar -fshort-enums -funsafe-math-optimizations -mvectorize-with-neon-quad
The dump of the different object files shows too many differences in assembly instructions , registers and addresses used.
Is it normal that compiler optimize/compile exactly the same source file differently and produce different object files ?! is it a compiler bug ?
How to avoid this behavior without turning off aggressive optimization ?
We'll need more information. The GCC bug reporting instructions (under the What we need heading) are a good template to use when reporting possible problems or difficulties with GCC:
Do you have a small preprocessed test case file (-save-temps, *.i* output) you can post?