aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2020-05-14 09:51:05 +0200
committerJakub Jelinek <jakub@redhat.com>2020-05-14 09:51:05 +0200
commitd0fb9ffc1b8f3b86bbdf0e915cec2136141b329b (patch)
tree6134d68b15fcb5d6601caaaa82290e0bd000b2be /gcc/testsuite/gcc.dg
parent49ddde69fc8e1e4c48d4b0027ea37ac862da0f1f (diff)
downloadgcc-d0fb9ffc1b8f3b86bbdf0e915cec2136141b329b.zip
gcc-d0fb9ffc1b8f3b86bbdf0e915cec2136141b329b.tar.gz
gcc-d0fb9ffc1b8f3b86bbdf0e915cec2136141b329b.tar.bz2
openmp: Fix placement of 2nd+ preparation statement for PHIs in simd clone lowering [PR95108]
For normal stmts, preparation statements are inserted before the stmt, so if we need multiple, they are in the correct order, but for PHIs we emit them after labels in the entry successor bb, and we used to emit them in the reverse order that way. 2020-05-14 Jakub Jelinek <jakub@redhat.com> PR middle-end/95108 * omp-simd-clone.c (struct modify_stmt_info): Add after_stmt member. (ipa_simd_modify_stmt_ops): For PHIs, only add before first stmt in entry block if info->after_stmt is NULL, otherwise add after that stmt and update it after adding each stmt. (ipa_simd_modify_function_body): Initialize info.after_stmt. * gcc.dg/gomp/pr95108.c: New test.
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r--gcc/testsuite/gcc.dg/gomp/pr95108.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/gomp/pr95108.c b/gcc/testsuite/gcc.dg/gomp/pr95108.c
new file mode 100644
index 0000000..b492333
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/pr95108.c
@@ -0,0 +1,18 @@
+/* PR middle-end/95108 */
+/* { dg-do compile { target vect_simd_clones } } */
+/* { dg-options "-O2 -fopenmp-simd -w" } */
+
+int *v;
+
+#pragma omp declare simd
+void
+foo (int x)
+{
+ int *a = &x + 1;
+
+ for (;;)
+ {
+ *v = *a;
+ a = v;
+ }
+}