http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50314
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-09-07 07:55:15 UTC --- > but I certainly didnt expect GCC to break my C statements and order them as > it wishes! It should be able to do that if the side effects are not exposed to the compiler. Can you attach the preprocessed source that reproduce the issue since the code that you provided does not show how BGndTimerReadNowIsr is defined. Is it inline-asm and was it marked with volatile?