This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix array access beyond bounds in test cases
- From: Jeff Law <law at redhat dot com>
- To: Siddhesh Poyarekar <siddhesh at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 09 Nov 2012 11:57:44 -0700
- Subject: Re: [PATCH] Fix array access beyond bounds in test cases
- References: <20121109124218.05b22661@spoyarek>
On 11/09/2012 12:12 AM, Siddhesh Poyarekar wrote:
Hi,For 31227 it's checking that an address formed by first computing an
address outside the array, then adding an offset with the end result
pointing at a valid location inside the array doesn't generate an
I found that some test cases access arrays beyond their bounds. I
looked up their originating bugzillas and found that the test
cases for pr22506 and pr34005 were likely to be typos since the
original test cases in the report do not have this problem. For
pr31227 however, I am inclined to think that the test case is
incorrect. I am not sure what the test case verifies since the array
accesses are obviously beyond bounds.
2012-11-09 Siddhesh Poyarekar <firstname.lastname@example.org>
* gcc.dg/Warray-bounds-3.c (bar): Keep array access within
bounds for ABDAY, DAY, ABMON, MON, AM_PM.
* gcc.dg/vect/pr22506.c (foo): Reduce loop iterations to within
* gcc.dg/vect/pr34005.c (XdmcpUnwrap): Likewise.
This style of address computation can sometimes be advantageous for the
loop optimizers to generate (my recollection is it's invalid C/C++ at
the source level).
The off-by-one aspects of 31227 ought to be corrected.
Ok for the trunk,