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

            Bug ID: 84047
           Summary: missing -Warray-bounds on a negative offset into a
                    string
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

In the distant past GCC would diagnose the out-of-bounds array access in the
following test case but it no longer does:

int f (void)
{
  const char *s = "12345678";
  int i = 1U << 30;
  return s[i];   // missing -Warray-bounds
}

Reply via email to