https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79979
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- No, undefined behavior means undefined behavior, anything can happen once you trigger it, it can format your disk, launch missiles, do nothing, do what you expect, do somethng different. The compiler optimizes on the assumption that the code is valid and does not invoke undefined behavior.