aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2020-08-31 13:36:09 +0200
committerRichard Biener <rguenther@suse.de>2020-08-31 13:42:31 +0200
commitf089569851ca9c8a81400dd8a159f86636ed20ec (patch)
tree901c94ce8bad4ca064068977c531741eb20343a0 /gcc
parent371fa005aeb5c84586fc3dcd37bbfd4d9215b7bb (diff)
downloadgcc-f089569851ca9c8a81400dd8a159f86636ed20ec.zip
gcc-f089569851ca9c8a81400dd8a159f86636ed20ec.tar.gz
gcc-f089569851ca9c8a81400dd8a159f86636ed20ec.tar.bz2
tree-optimization/96854 - testcase for SLP reduction of two-operator
This adds the testcase for the already fixed PR. 2020-08-31 Richard Biener <rguenther@suse.de> PR tree-optimization/96854 * gcc.dg/vect/pr96854.c: New testcase.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr96854.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/vect/pr96854.c b/gcc/testsuite/gcc.dg/vect/pr96854.c
new file mode 100644
index 0000000..e3980d4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr96854.c
@@ -0,0 +1,20 @@
+/* { dg-additional-options "-ffast-math" } */
+
+double _Complex __attribute__((noipa))
+foo (double _Complex acc, const double _Complex *x, const double _Complex* y, int N)
+{
+ for (int c = 0; c < N; ++c)
+ acc -= x[c] * y[c];
+ return acc;
+}
+
+int
+main()
+{
+ static const double _Complex y[] = { 1, 2, };
+ static const double _Complex x[] = { 1, 3, };
+ double _Complex ref = foo (0, x, y, 2);
+ if (__builtin_creal (ref) != -7.)
+ __builtin_abort ();
+ return 0;
+}