[Bug c++/83779] Trivial bounds error not detected with -fbounds-check
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jan 11 23:00:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83779
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |msebor at gcc dot gnu.org
--- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> ---
Not sure if that will help you but with -O1 and above, the test case triggers a
-Waggressive-loop-optimizations warning:
warning: iteration 20 invokes undefined behavior
[-Waggressive-loop-optimizations]
array1[i] = i;
~~~~~~~~~~^~~
z.c:7:3: note: within this loop
for (int i=0; i<25; i++)
^~~
More information about the Gcc-bugs
mailing list