[Bug c++/107798] optimizing -O3, "for" loop condition not checked anymore

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Nov 21 20:27:20 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107798

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
With -fsanitize=undefined we do detect the original undefined behavior at
runtime:

/app/example.cpp:21:50: runtime error: index 3 out of bounds for type 'A [3]'


More information about the Gcc-bugs mailing list