The value for that code is undefined. The compiler could be (and is allowed) to do all sorts of weird things like increment it twice at one point and not the other time, if it thinks that will make your program run faster. Never do anything like that in normal code.