This is 100% wrong. UB only happens in the code gen for programs that are illegal (per definition incorrect source code).If your program is correct, then the code cannot trigger UB.
How successful compilation of incorrect source code helps with writing correct software?
