This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/58101] Wrong out-of-bounds warning under -Os


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];
        ~~^~~

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]