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/43833] New: false warning: array subscript is above array bounds with -O3


$ 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


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