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 tree-optimization/84051] New: missing -Warray-bounds on an out-of-bounds access via an array pointer


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

            Bug ID: 84051
           Summary: missing -Warray-bounds on an out-of-bounds access via
                    an array pointer
           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: ---

GCC used to diagnose out-of-bounds accesses made by pointers to arrays of a
fixed bound.  The test case below shows it can no longer do that.   Clang and
ICC bot detect this bug.

typedef int A4[4];

int f (A4 *p)
{
  return (*p)[7];
}

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