Message ID | patch-14658-tamar@arm.com |
---|---|
State | New |
Headers | show |
Series | [1/4,committed] testsuite: Fix testisms in scalar tests PR101457 | expand |
On Thu, Jul 15, 2021 at 9:40 AM Tamar Christina via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > > Hi All, > > These testcases accidentally contain the wrong signs for the expected values > for the scalar code. The vector code however is correct. > > Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. > > Committed as a trivial fix. > > Thanks, > Tamar > > gcc/testsuite/ChangeLog: > > PR middle-end/101457 > * gcc.dg/vect/vect-reduc-dot-17.c: Fix signs of scalar code. > * gcc.dg/vect/vect-reduc-dot-18.c: Likewise. > * gcc.dg/vect/vect-reduc-dot-22.c: Likewise. > * gcc.dg/vect/vect-reduc-dot-9.c: Likewise. > > --- inline copy of patch -- > diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-17.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-17.c > index aa269c4d657f65e07e36df7f3fd0098cf3aaf4d0..38f86fe458adcc7ebbbae22f5cc1e720928f2d48 100644 > --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-17.c > +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-17.c > @@ -35,8 +35,9 @@ main (void) > { > check_vect (); > > - SIGNEDNESS_3 char a[N], b[N]; > - int expected = 0x12345; > + SIGNEDNESS_3 char a[N]; > + SIGNEDNESS_4 char b[N]; > + SIGNEDNESS_1 int expected = 0x12345; > for (int i = 0; i < N; ++i) > { > a[i] = BASE + i * 5; > diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-18.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-18.c > index 2b1cc0411c3256ccd876d8b4da18ce4881dc0af9..2e86ebe3c6c6a0da9ac242868592f30028ed2155 100644 > --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-18.c > +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-18.c > @@ -35,8 +35,9 @@ main (void) > { > check_vect (); > > - SIGNEDNESS_3 char a[N], b[N]; > - int expected = 0x12345; > + SIGNEDNESS_3 char a[N]; > + SIGNEDNESS_4 char b[N]; > + SIGNEDNESS_1 int expected = 0x12345; > for (int i = 0; i < N; ++i) > { > a[i] = BASE + i * 5; > diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-22.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-22.c > index febeb19784c6aaca72dc0871af0d32cc91fa6ea2..0bde43a6cb855ce5edd9015ebf34ca226353d77e 100644 > --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-22.c > +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-22.c > @@ -37,7 +37,7 @@ main (void) > > SIGNEDNESS_3 char a[N]; > SIGNEDNESS_4 short b[N]; > - int expected = 0x12345; > + SIGNEDNESS_1 long expected = 0x12345; Does it work with long == int? I still got FAIL: gcc.dg/vect/vect-reduc-dot-22.c -flto -ffat-lto-objects scan-tree-dump-not vect "vect_recog_dot_prod_pattern: detected" FAIL: gcc.dg/vect/vect-reduc-dot-22.c scan-tree-dump-not vect "vect_recog_dot_prod_pattern: detected" with -m32 on Linux/x86-64. > for (int i = 0; i < N; ++i) > { > a[i] = BASE + i * 5; > diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-9.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-9.c > index cbbeedec3bfd0810a8ce8036e6670585d9334924..d1049c96bf1febfc8933622e292b44cc8dd129cc 100644 > --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-9.c > +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-9.c > @@ -35,8 +35,9 @@ main (void) > { > check_vect (); > > - SIGNEDNESS_3 char a[N], b[N]; > - int expected = 0x12345; > + SIGNEDNESS_3 char a[N]; > + SIGNEDNESS_4 char b[N]; > + SIGNEDNESS_1 int expected = 0x12345; > for (int i = 0; i < N; ++i) > { > a[i] = BASE + i * 5; > > > --
> -----Original Message----- > From: H.J. Lu <hjl.tools@gmail.com> > Sent: Friday, July 16, 2021 3:21 AM > To: Tamar Christina <Tamar.Christina@arm.com> > Cc: GCC Patches <gcc-patches@gcc.gnu.org>; Richard Sandiford > <Richard.Sandiford@arm.com>; nd <nd@arm.com> > Subject: Re: [PATCH 1/4][committed] testsuite: Fix testisms in scalar tests > PR101457 > > On Thu, Jul 15, 2021 at 9:40 AM Tamar Christina via Gcc-patches <gcc- > patches@gcc.gnu.org> wrote: > > > > Hi All, > > > > These testcases accidentally contain the wrong signs for the expected > > values for the scalar code. The vector code however is correct. > > > > Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. > > > > Committed as a trivial fix. > > > > Thanks, > > Tamar > > > > gcc/testsuite/ChangeLog: > > > > PR middle-end/101457 > > * gcc.dg/vect/vect-reduc-dot-17.c: Fix signs of scalar code. > > * gcc.dg/vect/vect-reduc-dot-18.c: Likewise. > > * gcc.dg/vect/vect-reduc-dot-22.c: Likewise. > > * gcc.dg/vect/vect-reduc-dot-9.c: Likewise. > > > > --- inline copy of patch -- > > diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-17.c > > b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-17.c > > index > > > aa269c4d657f65e07e36df7f3fd0098cf3aaf4d0..38f86fe458adcc7ebbbae22f5cc > 1 > > e720928f2d48 100644 > > --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-17.c > > +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-17.c > > @@ -35,8 +35,9 @@ main (void) > > { > > check_vect (); > > > > - SIGNEDNESS_3 char a[N], b[N]; > > - int expected = 0x12345; > > + SIGNEDNESS_3 char a[N]; > > + SIGNEDNESS_4 char b[N]; > > + SIGNEDNESS_1 int expected = 0x12345; > > for (int i = 0; i < N; ++i) > > { > > a[i] = BASE + i * 5; > > diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-18.c > > b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-18.c > > index > > > 2b1cc0411c3256ccd876d8b4da18ce4881dc0af9..2e86ebe3c6c6a0da9ac2428685 > 92 > > f30028ed2155 100644 > > --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-18.c > > +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-18.c > > @@ -35,8 +35,9 @@ main (void) > > { > > check_vect (); > > > > - SIGNEDNESS_3 char a[N], b[N]; > > - int expected = 0x12345; > > + SIGNEDNESS_3 char a[N]; > > + SIGNEDNESS_4 char b[N]; > > + SIGNEDNESS_1 int expected = 0x12345; > > for (int i = 0; i < N; ++i) > > { > > a[i] = BASE + i * 5; > > diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-22.c > > b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-22.c > > index > > > febeb19784c6aaca72dc0871af0d32cc91fa6ea2..0bde43a6cb855ce5edd9015eb > f34 > > ca226353d77e 100644 > > --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-22.c > > +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-22.c > > @@ -37,7 +37,7 @@ main (void) > > > > SIGNEDNESS_3 char a[N]; > > SIGNEDNESS_4 short b[N]; > > - int expected = 0x12345; > > + SIGNEDNESS_1 long expected = 0x12345; > > Does it work with long == int? I still got Ah no, It requires double widening. I'll replace it with a long long. Thanks, Tamar > > FAIL: gcc.dg/vect/vect-reduc-dot-22.c -flto -ffat-lto-objects scan-tree-dump- > not vect "vect_recog_dot_prod_pattern: detected" > FAIL: gcc.dg/vect/vect-reduc-dot-22.c scan-tree-dump-not vect > "vect_recog_dot_prod_pattern: detected" > > with -m32 on Linux/x86-64. > > > for (int i = 0; i < N; ++i) > > { > > a[i] = BASE + i * 5; > > diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-9.c > > b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-9.c > > index > > > cbbeedec3bfd0810a8ce8036e6670585d9334924..d1049c96bf1febfc8933622e2 > 92b > > 44cc8dd129cc 100644 > > --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-9.c > > +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-9.c > > @@ -35,8 +35,9 @@ main (void) > > { > > check_vect (); > > > > - SIGNEDNESS_3 char a[N], b[N]; > > - int expected = 0x12345; > > + SIGNEDNESS_3 char a[N]; > > + SIGNEDNESS_4 char b[N]; > > + SIGNEDNESS_1 int expected = 0x12345; > > for (int i = 0; i < N; ++i) > > { > > a[i] = BASE + i * 5; > > > > > > -- > > > -- > H.J.
diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-17.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-17.c index aa269c4d657f65e07e36df7f3fd0098cf3aaf4d0..38f86fe458adcc7ebbbae22f5cc1e720928f2d48 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-17.c +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-17.c @@ -35,8 +35,9 @@ main (void) { check_vect (); - SIGNEDNESS_3 char a[N], b[N]; - int expected = 0x12345; + SIGNEDNESS_3 char a[N]; + SIGNEDNESS_4 char b[N]; + SIGNEDNESS_1 int expected = 0x12345; for (int i = 0; i < N; ++i) { a[i] = BASE + i * 5; diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-18.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-18.c index 2b1cc0411c3256ccd876d8b4da18ce4881dc0af9..2e86ebe3c6c6a0da9ac242868592f30028ed2155 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-18.c +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-18.c @@ -35,8 +35,9 @@ main (void) { check_vect (); - SIGNEDNESS_3 char a[N], b[N]; - int expected = 0x12345; + SIGNEDNESS_3 char a[N]; + SIGNEDNESS_4 char b[N]; + SIGNEDNESS_1 int expected = 0x12345; for (int i = 0; i < N; ++i) { a[i] = BASE + i * 5; diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-22.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-22.c index febeb19784c6aaca72dc0871af0d32cc91fa6ea2..0bde43a6cb855ce5edd9015ebf34ca226353d77e 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-22.c +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-22.c @@ -37,7 +37,7 @@ main (void) SIGNEDNESS_3 char a[N]; SIGNEDNESS_4 short b[N]; - int expected = 0x12345; + SIGNEDNESS_1 long expected = 0x12345; for (int i = 0; i < N; ++i) { a[i] = BASE + i * 5; diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-9.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-9.c index cbbeedec3bfd0810a8ce8036e6670585d9334924..d1049c96bf1febfc8933622e292b44cc8dd129cc 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-9.c +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-9.c @@ -35,8 +35,9 @@ main (void) { check_vect (); - SIGNEDNESS_3 char a[N], b[N]; - int expected = 0x12345; + SIGNEDNESS_3 char a[N]; + SIGNEDNESS_4 char b[N]; + SIGNEDNESS_1 int expected = 0x12345; for (int i = 0; i < N; ++i) { a[i] = BASE + i * 5;