Both standards allow for these instructions to be performed out of order, so long as that does not change observable behaviour. This is known as the as-if rule:
- What exactly is the “as-if” rule?
- http://en.cppreference.com/w/cpp/language/as_if
Note that as is pointed out in the comments, what is meant by “observable behaviour” is the observable behaviour of a program with defined behaviour. If your program has undefined behaviour, then the compiler is excused from reasoning about that.