The bug report is better reading: https://bugs.llvm.org/show_bug.cgi?id=49599
If undefined behavior would happen during an execution of a program, then that entire execution of the program is undefined behavior from the start.
Since all possible executions of this program will lead to undefined behavior, the compiler was free to emit any other program. It is permitted to get rid of all the code. You could say that Clang 13 missed an optimization opportunity here. It could have produced an empty file.
How is it clearly a bug? Undefined means undefined.
In C and C++, that's exactly what undefined behavior means. I think you're confusing it with unspecified behavior.
In the decades since, benchmark competition has given us the hostile mess we have today.