http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53046
--- Comment #12 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-04-23 11:42:28 UTC --- (In reply to comment #9) > Looking at the output of -fdump-tree-all, it looks like the compiler optimises > the loop which accesses an array out of bounds to: > > while(true); > > Is this expected behaviour? That seems like terrible output for every > situation... It's similar to other cases where undefined behavior leads to the GIGO principle. Other cases being a simple integer overflow inside a loop (not even necessarily the loop induction variable itself).