You would be surprised[0]. In low level code (in some cases) you'll need memory barriers[1] to ensure the proper order of instructions execution.
Even in higher level code your compiler's optimization algorithm may decide that it's faster to execute step 3 first if it thinks the result would be the same.
[0] https://en.wikipedia.org/wiki/Out-of-order_execution
[1] http://irl.cs.ucla.edu/~yingdi/web/paperreading/whymb.2010.0...