This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/84051] New: missing -Warray-bounds on an out-of-bounds access via an array pointer
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 26 Jan 2018 03:23:28 +0000
- Subject: [Bug tree-optimization/84051] New: missing -Warray-bounds on an out-of-bounds access via an array pointer
- Auto-submitted: auto-generated
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];
}