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.

Questions
  • Which bug in the papers do you find most surprising? Why?
  • Describe the most interesting or time-consuming bug you’ve encountered in CSE 333 exercises & homeworks.

Turn in your answers as Exercise 19.

Further readings