public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-2098] tree-optimization/34195 - testcase for fixed vectorization
@ 2021-07-07 11:50 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2021-07-07 11:50 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:005f31a0370cf35e332db9415a0ff538320bcddc

commit r12-2098-g005f31a0370cf35e332db9415a0ff538320bcddc
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Jul 7 13:46:48 2021 +0200

    tree-optimization/34195 - testcase for fixed vectorization
    
    This adds a testcase for an old fixed PR.
    
    2021-07-07  Richard Biener  <rguenther@suse.de>
    
            PR tree-optimization/34195
            * gcc.dg/vect/pr34195.c: New testcase.

Diff:
---
 gcc/testsuite/gcc.dg/vect/pr34195.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gcc/testsuite/gcc.dg/vect/pr34195.c b/gcc/testsuite/gcc.dg/vect/pr34195.c
new file mode 100644
index 00000000000..e36950ba429
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr34195.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_float } */
+
+#define M 11
+
+struct S
+{
+  float x;
+  float y;
+} pS[100];
+
+float a[1000];
+float b[1000];
+
+void
+foo (int n)
+{
+  int i, j;
+
+  for (i = 0; i < n; i++)
+    {
+      pS[i].x = 0;
+      pS[i].y = 0;
+
+      for (j = 0; j < M; j++)
+        {
+          pS[i].x += (a[i]+b[i]);
+          pS[i].y += (a[i]-b[i]);
+        }
+    }
+}
+
+/* { dg-final { scan-tree-dump "OUTER LOOP VECTORIZED" "vect" } } */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-07 11:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-07 11:50 [gcc r12-2098] tree-optimization/34195 - testcase for fixed vectorization Richard Biener

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).