> It's actually an interesting example where undefined behavior allowed compiler optimization
That is literally reason why any behavior is considered undefined. So that the compiler can skip checks to produce better optimized code.
That is literally reason why any behavior is considered undefined. So that the compiler can skip checks to produce better optimized code.