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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-10-07
     Ever confirmed|0                           |1

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
> gcc-5 -S t.c -O2 -Warray-bounds
t.c: In function ‘foo’:
t.c:7:14: warning: array subscript is above array bounds [-Warray-bounds]
     return a [4];
              ^

same with current trunk.  -O1 doesn't implement -Warray-bounds, it's
part of value-range analysis.

The uninit warning is a "feature", we optimize b[4] to "undefined"
(and too early to catch -Warray-bounds).

Confirmed for the fact that we miss a frontend based -Warray-bounds warning
that can warn for those simple cases.

Reply via email to