Patchwork Fix vectorization test case.

login
register
mail settings
Submitter tejas belagod
Date Aug. 18, 2010, 2:05 p.m.
Message ID <1282140304.15098.5.camel@e102484-lin.cambridge.arm.com>
Download mbox | patch
Permalink /patch/62042/
State New
Headers show

Comments

tejas belagod - Aug. 18, 2010, 2:05 p.m.
Hi,

One of the loops in gcc/testsuite/gcc.dg/vect/vect-1.c is suspect. A
two-level nested loop in foo() uses the same index variable for both
loops, but uses a different variable to access the matrix inside the
loop. I presume this is a typo as this loop is expected to vectorize.
Attached is a patch that fixes this.

--
Tejas Belagod
ARM.

gcc/testsuite

2010-08-18 Tejas Belagod <tejas.belagod@arm.com>

	* gcc.dg/vect/vect-1.c (foo): Change loop index variable.
Richard Guenther - Aug. 18, 2010, 2:21 p.m.
On Wed, Aug 18, 2010 at 4:05 PM, tejas belagod <tejas.belagod@arm.com> wrote:
> Hi,
>
> One of the loops in gcc/testsuite/gcc.dg/vect/vect-1.c is suspect. A
> two-level nested loop in foo() uses the same index variable for both
> loops, but uses a different variable to access the matrix inside the
> loop. I presume this is a typo as this loop is expected to vectorize.
> Attached is a patch that fixes this.

Ok.

Thanks,
Richard.

> --
> Tejas Belagod
> ARM.
>
> gcc/testsuite
>
> 2010-08-18 Tejas Belagod <tejas.belagod@arm.com>
>
>        * gcc.dg/vect/vect-1.c (foo): Change loop index variable.
>

Patch

Index: vect-1.c
===================================================================
--- vect-1.c	(revision 163337)
+++ vect-1.c	(working copy)
@@ -37,7 +37,7 @@ 
   /* Vectorizable.  */
   diff = 0;
   for (i = 0; i < N; i++) {
-    for (i = 0; i < N; i++) {
+    for (j = 0; j < N; j++) {
       diff += (image[i][j] - block[i][j]);
     }
   }