Not all code lines were compiled unless I declare local (stack) variables as 'volatile'.
That's optimisation for you!
This is expected behaviour.