&gt; This is the tip of the iceberg. How confident is any one now that their program doesn&#x27;t invoke UB? Things many programmer would assume are compiler errors are actually UB. What would happen if gcc&#x2F;clang exploited each one of these?<p>This is a pointless question. There is no reason for gcc and clang to exploit these, as there are no performance wins they could get by doing so. The analogy you&#x27;re giving presupposes that the developers of those compilers like making code insecure for fun, because they&#x27;re language lawyers. They aren&#x27;t doing that. They&#x27;re doing these optimizations because of documented, measurable performance gains, usually because someone filed a bug against the compiler asking why it didn&#x27;t optimize their code in the way they thought it should.