re PR c++/85782 (acc loops with continue statements ICE in c++)
authorCesar Philippidis <cesar@codesourcery.com>
Fri, 18 May 2018 15:43:09 +0000 (08:43 -0700)
committerCesar Philippidis <cesar@gcc.gnu.org>
Fri, 18 May 2018 15:43:09 +0000 (08:43 -0700)
PR c++/85782

gcc/cp/
* cp-gimplify.c (cp_genericize_r): Call genericize_omp_for_stmt for
OACC_LOOPs.

gcc/testsuite/
* c-c++-common/goacc/pr85782.c: New test.

libgomp/
* testsuite/libgomp.oacc-c-c++-common/pr85782.c: New test.

From-SVN: r260369

gcc/cp/ChangeLog
gcc/cp/cp-gimplify.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/goacc/pr85782.c [new file with mode: 0644]
libgomp/ChangeLog
libgomp/testsuite/libgomp.oacc-c-c++-common/pr85782.c [new file with mode: 0644]

index 014662b16a52fe945d270f37183026fef6456c32..c526771f43f73c44b2cd92e88a24296fe748ac5c 100644 (file)
@@ -1,3 +1,9 @@
+2018-05-18  Cesar Philippidis  <cesar@codesourcery.com>
+
+       PR c++/85782
+       * cp-gimplify.c (cp_genericize_r): Call genericize_omp_for_stmt for
+       OACC_LOOPs.
+
 2018-05-18  Richard Sandiford  <richard.sandiford@linaro.org>
 
        * constexpr.c (cxx_eval_constant_expression): Remove FMA_EXPR handling.
index eda5f05ea6a0be8fafcfd234ac9a12bb5d330aac..55aef86a2b8b1f174472c5cea42bb6e2b16a8ddb 100644 (file)
@@ -1463,6 +1463,7 @@ cp_genericize_r (tree *stmt_p, int *walk_subtrees, void *data)
     case OMP_FOR:
     case OMP_SIMD:
     case OMP_DISTRIBUTE:
+    case OACC_LOOP:
       genericize_omp_for_stmt (stmt_p, walk_subtrees, data);
       break;
 
index 683c13eafb09e168eeaaa8a0d95b2001504a7423..08f53f7838d52e22aa547e1ef5e7129732ef057a 100644 (file)
@@ -1,3 +1,8 @@
+2018-05-18  Cesar Philippidis  <cesar@codesourcery.com>
+
+       PR c++/85782
+       * c-c++-common/goacc/pr85782.c: New test.
+
 2018-05-18  Sudakshina Das  <sudi.das@arm.com>
 
        * gcc.target/aarch64/sve/slp_5.c: Remove xfail for tld1d and tld2d.
diff --git a/gcc/testsuite/c-c++-common/goacc/pr85782.c b/gcc/testsuite/c-c++-common/goacc/pr85782.c
new file mode 100644 (file)
index 0000000..f213a24
--- /dev/null
@@ -0,0 +1,11 @@
+/* PR c++/85782 */
+
+void
+foo ()
+{
+  int i;
+  
+  #pragma acc parallel loop
+  for (i = 0; i < 100; i++)
+    continue;
+}
index ff9c7a7b26973ceb2ed0238fe3b3e12b8a1aa98d..a184a0660c70676bc1ca480c52e272dfc6ad5c2a 100644 (file)
@@ -1,3 +1,8 @@
+2018-05-18  Cesar Philippidis  <cesar@codesourcery.com>
+
+       PR c++/85782
+       * testsuite/libgomp.oacc-c-c++-common/pr85782.c: New test.
+
 2018-05-09  Tom de Vries  <tom@codesourcery.com>
 
        PR libgomp/82901
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85782.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85782.c
new file mode 100644 (file)
index 0000000..6f84dfc
--- /dev/null
@@ -0,0 +1,32 @@
+/* PR c++/85782 */
+
+#include <assert.h>
+
+#define N 100
+
+int
+main ()
+{
+  int i, a[N];
+
+  for (i = 0; i < N; i++)
+    a[i] = i+1;
+
+  #pragma acc parallel loop copy(a)
+  for (i = 0; i < N; i++)
+    {
+      if (i % 2)
+       continue;
+      a[i] = 0;
+    }
+
+  for (i = 0; i < N; i++)
+    {
+      if (i % 2)
+       assert (a[i] == i+1);
+      else
+       assert (a[i] == 0);
+    }
+
+    return 0;
+}