This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/43833] New: false warning: array subscript is above array bounds with -O3
- From: "jiez at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Apr 2010 14:09:51 -0000
- Subject: [Bug middle-end/43833] New: false warning: array subscript is above array bounds with -O3
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
$ cat t.c
extern unsigned char data[5];
unsigned char
foo (char *str)
{
int i, j;
unsigned char c = 0;
for (i = 0; i < 8; i++)
{
j = i * 5;
if ((j % 8) > 3)
c |= data[(j / 8) + 1];
}
return c;
}
$ gcc t.c -O3 -Wall -c
t.c: In function ?foo?:
t.c:13:11: warning: array subscript is above array bounds
--
Summary: false warning: array subscript is above array bounds
with -O3
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
AssignedTo: jiez at gcc dot gnu dot org
ReportedBy: jiez at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43833