Hi Achim,
Yes, it might be possible that the compiler will re-order the code if using optimizations. This is because the compiler analyzes a function’s flow of execution and how the function uses variables and then uses this information to find shortcuts in execution and reduce the number of registers and memory that the function uses.
You could use the following optimization pragma to disable the optimizations on a section of code:
#pragma optimization_level 0
You can find more information about this on the document "CodeWarrior Development Studio ColdFire® Architectures Edition Build Tools Reference" located on the path C:\Program Files\Freescale\CodeWarrior for ColdFire V6.4\Help\PDF
Hope it helps!
Best Regards,
Carlos Mendoza
Technical Support Engineer