Compilers are way too overzealous eliminating code because of undefined behavior.  Legally it is allowed and I&#x27;m sure it helps in synthetic benchmarks. But writers of real programs won&#x27;t be impressed of the perf gains when you stop running half their program.