Read Towards optimization-safe systems: Analyzing the impact of undefined behavior. Focus on sections 1, 2, and 6.
Also, skim section 2 of “Undefined behavior: What happened to my code?”, which describes more interesting examples.
Try to understand what compilers can do to your code and what the consequences are.
Turn in your answers as Exercise 19.