The compiler causing undefined behavior on its own reminds me of one of the fun bugs we found[1] with 32-bit x86 clang where one compiler pass fools another into thinking there&#x27;s an undefined behavior by combining three struct field initializations into a single 4-byte load, but the struct itself was 3-bytes long. Another pass looked at this and thought there&#x27;s an undefined behavior writing past the struct boundary, silently eliminating the initialization altogether, resulting in bad codegen.<p>[1]: <a href="https:&#x2F;&#x2F;mehrdad.afshari.me&#x2F;pubs&#x2F;compiler-validation-via-equivalence-modulo-inputs.pdf" rel="nofollow">https:&#x2F;&#x2F;mehrdad.afshari.me&#x2F;pubs&#x2F;compiler-validation-via-equi...</a>