$ 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