http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60861
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> --- I'd say it is fine for test to be optimized to 1 at -O2, but am not sure we want to do that even for -O0 (and if we disable it for -O0, whether we want it for -Og). Then it will be user's choice whether he wants to instrument optimized code (where there is no out of bound access), or non-optimized code (where there would be out of bounds access).