Patchwork [testsuite] fix loop index for gcc.dg/webizer.c

login
register
mail settings
Submitter Janis Johnson
Date Jan. 15, 2013, 9:57 p.m.
Message ID <50F5D0B6.6000708@mentor.com>
Download mbox | patch
Permalink /patch/212313/
State New
Headers show

Comments

Janis Johnson - Jan. 15, 2013, 9:57 p.m.
Execution of test gcc.dg/webizer.c fails with a segfault for
powerpc-eabi with the GNU simulator.  The test has an array of size 2
and accesses that array with indices of 1 and 2.  This patch fixes the
bounds of the loop index.

Tested on powerpc-none-eabi; OK for trunk?

Janis
2013-01-15  Janis Johnson  <janisjo@codesourcery.com>

	* gcc.dg/webizer.c: Adjust loop variable.
Jeff Law - Jan. 15, 2013, 10:01 p.m.
On 01/15/2013 02:57 PM, Janis Johnson wrote:
> Execution of test gcc.dg/webizer.c fails with a segfault for
> powerpc-eabi with the GNU simulator.  The test has an array of size 2
> and accesses that array with indices of 1 and 2.  This patch fixes the
> bounds of the loop index.
>
> Tested on powerpc-none-eabi; OK for trunk?
Based on:


http://gcc.gnu.org/ml/gcc-patches/2012-10/msg01259.html

I think the the loop variables are fairly important.  I think we're less 
likely to perturb the test by increasing the size of the array.

Jeff
Janis Johnson - Jan. 15, 2013, 10:08 p.m.
On 01/15/2013 02:01 PM, Jeff Law wrote:
> On 01/15/2013 02:57 PM, Janis Johnson wrote:
>> Execution of test gcc.dg/webizer.c fails with a segfault for
>> powerpc-eabi with the GNU simulator.  The test has an array of size 2
>> and accesses that array with indices of 1 and 2.  This patch fixes the
>> bounds of the loop index.
>>
>> Tested on powerpc-none-eabi; OK for trunk?
> Based on:
> 
> 
> http://gcc.gnu.org/ml/gcc-patches/2012-10/msg01259.html
> 
> I think the the loop variables are fairly important.  I think we're less 
> likely to perturb the test by increasing the size of the array.
> 
> Jeff

Increasing the size of the array to 3 works.  OK to do that?

Janis
Jeff Law - Jan. 15, 2013, 10:16 p.m.
On 01/15/2013 03:08 PM, Janis Johnson wrote:
> On 01/15/2013 02:01 PM, Jeff Law wrote:
>> On 01/15/2013 02:57 PM, Janis Johnson wrote:
>>> Execution of test gcc.dg/webizer.c fails with a segfault for
>>> powerpc-eabi with the GNU simulator.  The test has an array of size 2
>>> and accesses that array with indices of 1 and 2.  This patch fixes the
>>> bounds of the loop index.
>>>
>>> Tested on powerpc-none-eabi; OK for trunk?
>> Based on:
>>
>>
>> http://gcc.gnu.org/ml/gcc-patches/2012-10/msg01259.html
>>
>> I think the the loop variables are fairly important.  I think we're less
>> likely to perturb the test by increasing the size of the array.
>>
>> Jeff
>
> Increasing the size of the array to 3 works.  OK to do that?
Yes.  That sounds good.  Please install.

jeff

Patch

Index: testsuite/gcc.dg/webizer.c
===================================================================
--- testsuite/gcc.dg/webizer.c	(revision 195216)
+++ testsuite/gcc.dg/webizer.c	(working copy)
@@ -21,7 +21,7 @@ 
 configure2()
 {
   block = 0 ;
-  for( row = 1 ; row <= numRows ; row++ ) {
+  for( row = 0 ; row < numRows ; row++ ) {
       block++ ;
     if( rowArray[row].endx1 > 0 ) {
       block++ ;