http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56463
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-02-26 17:53:43 UTC --- The compiler may assume that undefined behavior doesn't happen in the program. It is fine to have undefined behavior in code that will be never executed, but as soon as you hit it, the program can do anything.