+cc jakub On Tue, Feb 4, 2014 at 4:59 PM, Paul Pluzhnikov <ppluzhni...@google.com> wrote: > Greetings, > > The gcc.dg/vect/no-vfa-vect-depend-2.c failed for us, when linked with > gold, but not when linked with BFD ld. > > The problem appears to be off-by-one error causing array out of bounds > access, fixed by attached patch.
Alternate fix (used in no-vfa-vect-depend-3.c): --- gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-2.c (revision 207487) +++ gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-2.c (working copy) @@ -5,8 +5,8 @@ #define N 17 -int ia[N] = {48,45,42,39,36,33,30,27,24,21,18,15,12,9,6,3,0}; -int ib[N] = {48,45,42,39,36,33,30,27,24,21,18,15,12,9,6,3,0}; +int ia[N + 1] = {48,45,42,39,36,33,30,27,24,21,18,15,12,9,6,3,0}; +int ib[N + 1] = {48,45,42,39,36,33,30,27,24,21,18,15,12,9,6,3,0}; int res[N] = {48,192,180,168,156,144,132,120,108,96,84,72,60,48,36,24,12}; __attribute__ ((noinline)) > > OK for trunk? > > Thanks, > > > gcc/testsuite/ChangeLog: > > 2014-02-04 Paul Pluzhnikov <ppluzhni...@google.com> > > * gcc.dg/vect/no-vfa-vect-depend-2.c (main1): Fix buffer > overflow. > > > Index: gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-2.c > =================================================================== > --- gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-2.c (revision 207487) > +++ gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-2.c (working copy) > @@ -15,7 +15,7 @@ > int i; > > /* Not vectorizable due to data dependence: dependence distance 1. */ > - for (i = N - 1; i >= 0; i--) > + for (i = N - 2; i >= 0; i--) > { > ia[i] = ia[i+1] * 4; > } > @@ -28,7 +28,7 @@ > } > > /* Vectorizable. Dependence distance -1. */ > - for (i = N - 1; i >= 0; i--) > + for (i = N - 2; i >= 0; i--) > { > ib[i+1] = ib[i] * 4; > } -- Paul Pluzhnikov