[Bug middle-end/58101] Wrong out-of-bounds warning under -Os
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Dec 16 02:59:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58101
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2015-12-16
CC| |msebor at gcc dot gnu.org
Ever confirmed|0 |1
Known to fail| |4.9.3, 5.1.0, 6.0
--- Comment #5 from Martin Sebor <msebor at gcc dot gnu.org> ---
Confirmed with 5.1 and 6.0. A simpler test case:
$ cat a.c && /home/msebor/build/gcc-trunk-svn/gcc/xgcc -shared-libgcc
-B/home/msebor/build/gcc-trunk-svn/gcc -Os -S -Wall -o/dev/null a.c
int a [1];
void foo (int n)
{
for (int i = 1; i < n; i++)
a [i] = a [i - 1];
}
a.c: In function ‘foo’:
a.c:6:10: warning: array subscript is above array bounds [-Warray-bounds]
a [i] = a [i - 1];
~~^~~
More information about the Gcc-bugs
mailing list