Compiler optimization is a tricky business, where every vendor does all they can to beat the benchmarks game.
What gets documented on the standard is what compiler vendors that bother to seat at ANSI C meetings agree to document as such.
By no means does the standard forbid compiler vendors to take advantage of situations not yet documented as such.
Eventually new cases of UB might get added to the standard.
The current set of about 200 scenarios of UB in C11 weren't all there in C89.
Another example, is that you can have code that is perfectly valid, UB free, but thanks to PGO and code re-writting rules on the optimizer stage, gets rewritten with UB side effects at a later stage in the optimizer pipeline.
> Even if the generated code is clean today regarding UB, you cannot ensure that a new C compiler version won't be introducing such issues.
This is not correct. Undefined behaviour is specified in the standard, and a good compiler-to-C will always generate UB-free code.