He gets different results with and without optimization because without optimization the result of the calculation is spilled to the i unsigned int and then reloaded for the print call. This save and reload truncated the value to its real value. In the optimized version, the compiler removed the spill and the overflowed value contained in the register is printed as is.

Btw you are actually confirming what I said.

if (i != 0xFFFFFFFF) ...

In the optimized version, when the 64 bits "i" value is compared to a 32 bits constant, the test fails...

Proof that the value is stored in a **64** bits register, not 32...

Reply via email to