public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: [PATCH] testsuite: Fix up scev-16.c test [PR113446]
  2024-01-18  7:41 [PATCH] testsuite: Fix up scev-16.c test [PR113446] Jakub Jelinek
@ 2024-01-18  7:40 ` Richard Biener
  2024-01-18  7:51   ` Jakub Jelinek
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Biener @ 2024-01-18  7:40 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: gcc-patches

On Thu, 18 Jan 2024, Jakub Jelinek wrote:

> Hi!
> 
> This test FAILs on i686-linux or e.g. sparc*-solaris*, because
> it uses vect_int effective target outside of */vect/ testsuite.
> That is wrong, vect_int assumes the extra added flags by vect.exp
> by default, which aren't added in other testsuites.
> 
> The following patch fixes that by moving the test into gcc.dg/vect/
> and doing small tweaks.
> 
> Regtested on x86_64-linux and i686-linux, ok for trunk?

OK, note -O2 -ftree-vectorize are default in vect.exp (so is
-fno-vect-cost-model)

> 2024-01-18  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR tree-optimization/112774
> 	PR testsuite/113446
> 	* gcc.dg/tree-ssa/scev-16.c: Move test ...
> 	* gcc.dg/vect/pr112774.c: ... here.  Add PR comment line, use
> 	dg-additional-options instead of dg-options and drop
> 	-fdump-tree-vect-details.
> 
> --- gcc/testsuite/gcc.dg/tree-ssa/scev-16.c.jj	2023-12-08 08:28:23.790168953 +0100
> +++ gcc/testsuite/gcc.dg/tree-ssa/scev-16.c	2024-01-17 18:21:26.397146209 +0100
> @@ -1,18 +0,0 @@
> -/* { dg-do compile } */
> -/* { dg-require-effective-target vect_int } */
> -/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details" } */
> -
> -int A[1024 * 2];
> -
> -int foo (unsigned offset, unsigned N)
> -{
> -  int sum = 0;
> -
> -  for (unsigned i = 0; i < N; i++)
> -    sum += A[i + offset];
> -
> -  return sum;
> -}
> -
> -/* Loop can be vectorized by referring "i + offset" is nonwrapping from array.  */
> -/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { target { ! { avr-*-* msp430-*-* pru-*-* } } } } } */
> --- gcc/testsuite/gcc.dg/vect/pr112774.c.jj	2024-01-17 18:20:25.401978923 +0100
> +++ gcc/testsuite/gcc.dg/vect/pr112774.c	2024-01-17 18:21:16.194285496 +0100
> @@ -0,0 +1,19 @@
> +/* PR tree-optimization/112774 */
> +/* { dg-do compile } */
> +/* { dg-require-effective-target vect_int } */
> +/* { dg-additional-options "-O2 -ftree-vectorize" } */
> +
> +int A[1024 * 2];
> +
> +int foo (unsigned offset, unsigned N)
> +{
> +  int sum = 0;
> +
> +  for (unsigned i = 0; i < N; i++)
> +    sum += A[i + offset];
> +
> +  return sum;
> +}
> +
> +/* Loop can be vectorized by referring "i + offset" is nonwrapping from array.  */
> +/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { target { ! { avr-*-* msp430-*-* pru-*-* } } } } } */
> 
> 	Jakub
> 
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE Software Solutions Germany GmbH,
Frankenstrasse 146, 90461 Nuernberg, Germany;
GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] testsuite: Fix up scev-16.c test [PR113446]
@ 2024-01-18  7:41 Jakub Jelinek
  2024-01-18  7:40 ` Richard Biener
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Jelinek @ 2024-01-18  7:41 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

Hi!

This test FAILs on i686-linux or e.g. sparc*-solaris*, because
it uses vect_int effective target outside of */vect/ testsuite.
That is wrong, vect_int assumes the extra added flags by vect.exp
by default, which aren't added in other testsuites.

The following patch fixes that by moving the test into gcc.dg/vect/
and doing small tweaks.

Regtested on x86_64-linux and i686-linux, ok for trunk?

2024-01-18  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/112774
	PR testsuite/113446
	* gcc.dg/tree-ssa/scev-16.c: Move test ...
	* gcc.dg/vect/pr112774.c: ... here.  Add PR comment line, use
	dg-additional-options instead of dg-options and drop
	-fdump-tree-vect-details.

--- gcc/testsuite/gcc.dg/tree-ssa/scev-16.c.jj	2023-12-08 08:28:23.790168953 +0100
+++ gcc/testsuite/gcc.dg/tree-ssa/scev-16.c	2024-01-17 18:21:26.397146209 +0100
@@ -1,18 +0,0 @@
-/* { dg-do compile } */
-/* { dg-require-effective-target vect_int } */
-/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details" } */
-
-int A[1024 * 2];
-
-int foo (unsigned offset, unsigned N)
-{
-  int sum = 0;
-
-  for (unsigned i = 0; i < N; i++)
-    sum += A[i + offset];
-
-  return sum;
-}
-
-/* Loop can be vectorized by referring "i + offset" is nonwrapping from array.  */
-/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { target { ! { avr-*-* msp430-*-* pru-*-* } } } } } */
--- gcc/testsuite/gcc.dg/vect/pr112774.c.jj	2024-01-17 18:20:25.401978923 +0100
+++ gcc/testsuite/gcc.dg/vect/pr112774.c	2024-01-17 18:21:16.194285496 +0100
@@ -0,0 +1,19 @@
+/* PR tree-optimization/112774 */
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+/* { dg-additional-options "-O2 -ftree-vectorize" } */
+
+int A[1024 * 2];
+
+int foo (unsigned offset, unsigned N)
+{
+  int sum = 0;
+
+  for (unsigned i = 0; i < N; i++)
+    sum += A[i + offset];
+
+  return sum;
+}
+
+/* Loop can be vectorized by referring "i + offset" is nonwrapping from array.  */
+/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { target { ! { avr-*-* msp430-*-* pru-*-* } } } } } */

	Jakub


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] testsuite: Fix up scev-16.c test [PR113446]
  2024-01-18  7:40 ` Richard Biener
@ 2024-01-18  7:51   ` Jakub Jelinek
  0 siblings, 0 replies; 3+ messages in thread
From: Jakub Jelinek @ 2024-01-18  7:51 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

On Thu, Jan 18, 2024 at 08:40:04AM +0100, Richard Biener wrote:
> > This test FAILs on i686-linux or e.g. sparc*-solaris*, because
> > it uses vect_int effective target outside of */vect/ testsuite.
> > That is wrong, vect_int assumes the extra added flags by vect.exp
> > by default, which aren't added in other testsuites.
> > 
> > The following patch fixes that by moving the test into gcc.dg/vect/
> > and doing small tweaks.
> > 
> > Regtested on x86_64-linux and i686-linux, ok for trunk?
> 
> OK, note -O2 -ftree-vectorize are default in vect.exp (so is
> -fno-vect-cost-model)

It is actually the check_vect_support_and_set_flags added flags
here, so on i686-linux -msse2, on sparc*-* -mcpu=ultrasparc -mvis,
-mvsx -mno-allow-movmisalign or -mcpu=970 on some powerpc*,
etc. that matters here.

	Jakub


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-01-18  7:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-18  7:41 [PATCH] testsuite: Fix up scev-16.c test [PR113446] Jakub Jelinek
2024-01-18  7:40 ` Richard Biener
2024-01-18  7:51   ` Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).