The compiler will unwind your statments, it MAY accept a read-after-write as a workaround, but unless that value is being used anywhere else the compiler might be smart enough to remove it away again. You need to be able to tell the compiler to leave your procedure alone not matter what it wants to optimize.