This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Don't issue array bound warnings on zero-length arrays
- From: Jeff Law <law at redhat dot com>
- To: Meador Inge <meadori at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 30 Aug 2013 10:02:35 -0600
- Subject: Re: [PATCH] Don't issue array bound warnings on zero-length arrays
- Authentication-results: sourceware.org; auth=none
- References: <1377875587-18004-1-git-send-email-meadori at codesourcery dot com>
On 08/30/2013 09:13 AM, Meador Inge wrote:
Hi All,
This patch fixes a minor issue that can occur when issuing array bounds
warnings. In GNU C mode we allow empty lists and their upper bound is
initialized to -1. This confuses the array bound analysis in VRP and
in some cases we end up issuing false positives. This patch fixes
the issue by bailing out when a zero-length array is encountered.
OK for trunk?
gcc/
2013-08-30 Meador Inge <meadori@codesourcery.com>
* tree-vrp.c (check_array_ref): Bail out no emtpy arrays.
gcc/testsuite/
2013-08-30 Meador Inge <meadori@codesourcery.com>
* gcc.dg/Warray-bounds-11.c: New testcase.
OK for the trunk. Thanks,
Jeff