Really interesting blog post describing a case where GCC developers decided to not exploit undefined behaviour: https://blog.regehr.org/archives/767