aboutsummaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2018-11-26 15:37:35 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2018-11-26 15:37:35 +0000
commitef6e6914c8245ca24dae952bc054ae2328e751ab (patch)
tree99a95accf31970bfb7c5ca83ed8d9a15a5e4db6f /libgomp
parentc393c7482fa7c6953f256724e8c6bd282d404e7c (diff)
downloadgcc-ef6e6914c8245ca24dae952bc054ae2328e751ab.zip
gcc-ef6e6914c8245ca24dae952bc054ae2328e751ab.tar.gz
gcc-ef6e6914c8245ca24dae952bc054ae2328e751ab.tar.bz2
re PR tree-optimization/88182 (ICE in vectorizable_reduction, at tree-vect-loop.c:6465)
2018-11-26 Richard Biener <rguenther@suse.de> PR tree-optimization/88182 * tree-vect-loop.c (vectorizable_reduction): Pick up single correct reduc_def_info. * tree-vect-slp.c (vect_analyze_slp_instance): Set STMT_VINFO_REDUC_DEF of the first stmt. libgomp/ * testsuite/libgomp.c++/pr88182.C: New testcase. From-SVN: r266467
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/ChangeLog5
-rw-r--r--libgomp/testsuite/libgomp.c++/pr88182.C42
2 files changed, 47 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 4037356..7068355 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,8 @@
+2018-11-26 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/88182
+ * testsuite/libgomp.c++/pr88182.C: New testcase.
+
2018-11-20 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/88106
diff --git a/libgomp/testsuite/libgomp.c++/pr88182.C b/libgomp/testsuite/libgomp.c++/pr88182.C
new file mode 100644
index 0000000..2e3ac69
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/pr88182.C
@@ -0,0 +1,42 @@
+// { dg-do run }
+// { dg-options "-O -fopenmp -ftree-loop-if-convert -fno-ssa-phiopt" }
+
+#pragma omp declare simd simdlen(4) notinbranch
+__attribute__((noinline)) int
+foo (double c1, double c2)
+{
+ double z1 = c1, z2 = c2;
+ int res = 100, i;
+
+ for (i = 0; i < 5; i++)
+ {
+ res = (z1 * z1 + z2 * z2 > 4.0) ? (i < res ? i : res) : res;
+ z1 = c1 + z1 * z1 - z2 * z2;
+ z2 = c2 + 2.0 * z1 * z2;
+ c1 += 0.5;
+ c2 += 0.5;
+ }
+ return res;
+}
+
+__attribute__((noinline, noclone)) void
+bar (double *x, double *y)
+{
+ asm volatile ("" : : "rm" (x), "rm" (y) : "memory");
+}
+
+int
+main ()
+{
+ int i;
+ double c[4] = { 0.0, 1.0, 0.0, 1.0 };
+ double d[4] = { 0.0, 1.0, 2.0, 0.0 };
+ int e[4];
+ bar (c, d);
+#pragma omp simd safelen(4)
+ for (i = 0; i < 4; i++)
+ e[i] = foo (c[i], d[i]);
+ if (e[0] != 3 || e[1] != 1 || e[2] != 1 || e[3] != 2)
+ __builtin_abort ();
+ return 0;
+}