This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/38480] bogus warning with -O3 -Wall: "array subscript is above array bounds"
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Dec 2008 20:40:17 -0000
- Subject: [Bug tree-optimization/38480] bogus warning with -O3 -Wall: "array subscript is above array bounds"
- References: <bug-38480-17064@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from pinskia at gcc dot gnu dot org 2008-12-16 20:40 -------
we have:
unsigned short foobar;
int i = (int)foobar;
if (i > 99)
if (foobar <= 99)
access array[i];
so i can never be negative and foobar will never be greater than 99.
This is both a missed optimization dealing with VRP and a diagnostic issue.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Component|c |tree-optimization
Ever Confirmed|0 |1
Keywords| |diagnostic, missed-
| |optimization
Last reconfirmed|0000-00-00 00:00:00 |2008-12-16 20:40:17
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38480