On Wed, Aug 25, 2021 at 11:26 AM guojiufu <guoji...@linux.ibm.com> wrote: > > On 2021-08-16 09:33, Bin.Cheng wrote: > > On Wed, Aug 4, 2021 at 10:42 AM guojiufu <guoji...@linux.ibm.com> > > wrote: > >> > ... > >> >> diff --git a/gcc/testsuite/gcc.dg/vect/pr101145.inc > >> >> b/gcc/testsuite/gcc.dg/vect/pr101145.inc > >> >> new file mode 100644 > >> >> index 00000000000..6eed3fa8aca > >> >> --- /dev/null > >> >> +++ b/gcc/testsuite/gcc.dg/vect/pr101145.inc > >> >> @@ -0,0 +1,63 @@ > >> >> +TYPE __attribute__ ((noinline)) > >> >> +foo_sign (int *__restrict__ a, int *__restrict__ b, TYPE l, TYPE n) > >> >> +{ > >> >> + for (l = L_BASE; n < l; l += C) > >> >> + *a++ = *b++ + 1; > >> >> + return l; > >> >> +} > >> >> + > >> >> +TYPE __attribute__ ((noinline)) > >> >> +bar_sign (int *__restrict__ a, int *__restrict__ b, TYPE l, TYPE n) > >> >> +{ > >> >> + for (l = L_BASE_DOWN; l < n; l -= C) > > I noticed that both L_BASE and L_BASE_DOWN are defined as l, which > > makes this test a bit confusing. Could you clean the use of l, for > > example, by using an auto var for the loop index invariable? > > Otherwise the patch looks good to me. Thanks very much for the work. > > Hi, > > Sorry for bothering you here. > I feel this would be an approval (with the comment) already :) > > With the change code to make it a little clear as: > TYPE i; > for (i = l; n < i; i += C) > > it may be ok to commit the patch to the trunk, right? Yes please. Thanks again for working on this.
Thanks, bin > > BR, > Jiufu > > > > > Thanks, > > bin > >> >> + *a++ = *b++ + 1; > >> >> + return l; > >> >> +} > >> >> + > >> >> +int __attribute__ ((noinline)) neq (int a, int b) { return a != b; } > >> >> + > >> >> +int a[1000], b[1000]; > >> >> +int fail; > >> >> + > >> >> +int > ... > >> >> diff --git a/gcc/testsuite/gcc.dg/vect/pr101145_1.c > >> >> b/gcc/testsuite/gcc.dg/vect/pr101145_1.c > >> >> new file mode 100644 > >> >> index 00000000000..94f6b99b893 > >> >> --- /dev/null > >> >> +++ b/gcc/testsuite/gcc.dg/vect/pr101145_1.c > >> >> @@ -0,0 +1,15 @@ > >> >> +/* { dg-require-effective-target vect_int } */ > >> >> +/* { dg-options "-O3 -fdump-tree-vect-details" } */ > >> >> +#define TYPE signed char > >> >> +#define MIN -128 > >> >> +#define MAX 127 > >> >> +#define N_BASE (MAX - 32) > >> >> +#define N_BASE_DOWN (MIN + 32) > >> >> + > >> >> +#define C 3 > >> >> +#define L_BASE l > >> >> +#define L_BASE_DOWN l > >> >> +