Re: [PATCH] Fix array access beyond bounds in test cases

2012-11-09 Thread Jeff Law

On 11/09/2012 12:12 AM, Siddhesh Poyarekar wrote:

Hi,

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.

Regards,
Siddhesh

testsuite/ChangeLog:

2012-11-09  Siddhesh Poyarekar  

* 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
array bounds.
* gcc.dg/vect/pr34005.c (XdmcpUnwrap): Likewise.
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 
incorrect warning.


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,
jeff


Re: [PATCH] Fix array access beyond bounds in test cases

2012-11-09 Thread Siddhesh Poyarekar
On Fri, 09 Nov 2012 11:57:44 -0700, Jeff wrote:
> The off-by-one aspects of 31227 ought to be corrected.
> 
> Ok for the trunk,

I don't have write access (not sure if I qualify for it yet with just a
couple of trivial patches so far) so I need someone to commit for me.

Thanks,
Siddhesh


Re: [PATCH] Fix array access beyond bounds in test cases

2012-11-09 Thread Jeff Law

On 11/09/2012 12:14 PM, Siddhesh Poyarekar wrote:

On Fri, 09 Nov 2012 11:57:44 -0700, Jeff wrote:

The off-by-one aspects of 31227 ought to be corrected.

Ok for the trunk,


I don't have write access (not sure if I qualify for it yet with just a
couple of trivial patches so far) so I need someone to commit for me.

OK.  I took care of committing for you.

jeff