From 950ad0bafece295e34e5d3912da0d0314cd0dad1 Mon Sep 17 00:00:00 2001 From: Cesar Philippidis Date: Fri, 18 May 2018 08:43:09 -0700 Subject: [PATCH] re PR c++/85782 (acc loops with continue statements ICE in c++) 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 | 6 ++++ gcc/cp/cp-gimplify.c | 1 + gcc/testsuite/ChangeLog | 5 +++ gcc/testsuite/c-c++-common/goacc/pr85782.c | 11 +++++++ libgomp/ChangeLog | 5 +++ .../libgomp.oacc-c-c++-common/pr85782.c | 32 +++++++++++++++++++ 6 files changed, 60 insertions(+) create mode 100644 gcc/testsuite/c-c++-common/goacc/pr85782.c create mode 100644 libgomp/testsuite/libgomp.oacc-c-c++-common/pr85782.c diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 014662b16a5..c526771f43f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2018-05-18 Cesar Philippidis + + PR c++/85782 + * cp-gimplify.c (cp_genericize_r): Call genericize_omp_for_stmt for + OACC_LOOPs. + 2018-05-18 Richard Sandiford * constexpr.c (cxx_eval_constant_expression): Remove FMA_EXPR handling. diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c index eda5f05ea6a..55aef86a2b8 100644 --- a/gcc/cp/cp-gimplify.c +++ b/gcc/cp/cp-gimplify.c @@ -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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 683c13eafb0..08f53f7838d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-05-18 Cesar Philippidis + + PR c++/85782 + * c-c++-common/goacc/pr85782.c: New test. + 2018-05-18 Sudakshina Das * 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 index 00000000000..f213a24be9f --- /dev/null +++ b/gcc/testsuite/c-c++-common/goacc/pr85782.c @@ -0,0 +1,11 @@ +/* PR c++/85782 */ + +void +foo () +{ + int i; + + #pragma acc parallel loop + for (i = 0; i < 100; i++) + continue; +} diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index ff9c7a7b269..a184a0660c7 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,8 @@ +2018-05-18 Cesar Philippidis + + PR c++/85782 + * testsuite/libgomp.oacc-c-c++-common/pr85782.c: New test. + 2018-05-09 Tom de Vries 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 index 00000000000..6f84dfc7d8f --- /dev/null +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85782.c @@ -0,0 +1,32 @@ +/* PR c++/85782 */ + +#include + +#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; +} -- 2.30.2