http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59933
--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> --- We have -fsanitize=undefined which can catch some issues, though the array bounds instrumentation (nor __builtin_object_size based instrumentation) has not been added yet for GCC 4.9, will be hopefully there in the next release. As for warnings, even the current -Waggressive-loop-optimizationsh warning (for the const number of iterations, single loop exit easy case where you know that if the loop is reachable, if there is undefined behavior in some loop iteration, you will trigger it) still has occassional false positives (various PRs about that, usually the issue is that while it is true there is such a loop, the loop is actually dead), further warnings would have huge false positive rate, to the extent that it would be rarely useful.