diff options
author | Cesar Philippidis <cesar@gcc.gnu.org> | 2017-03-22 06:52:10 -0700 |
---|---|---|
committer | Cesar Philippidis <cesar@gcc.gnu.org> | 2017-03-22 06:52:10 -0700 |
commit | 7ba8651ed253b29ee17a0d735cc74eac1b826492 (patch) | |
tree | d6411b1c55001c5719c4dc9933386850cae58c7f /libgomp | |
parent | bf634d1c4c9cc3cd3a4523ab4178b94398892ded (diff) | |
download | gcc-7ba8651ed253b29ee17a0d735cc74eac1b826492.zip gcc-7ba8651ed253b29ee17a0d735cc74eac1b826492.tar.gz gcc-7ba8651ed253b29ee17a0d735cc74eac1b826492.tar.bz2 |
re PR c++/80029 (valgrind error in new_omp_context(omp_region_type) (gimplify.c:400))
PR c++/80029
gcc/
* gimplify.c (is_oacc_declared): New function.
(oacc_default_clause): Use it to set default flags for acc declared
variables inside parallel regions.
(gimplify_scan_omp_clauses): Strip firstprivate pointers for acc
declared variables.
(gimplify_oacc_declare): Gimplify the declare clauses. Add the
declare attribute to any decl as necessary.
libgomp/
* testsuite/libgomp.oacc-c-c++-common/declare-vla.c: New test.
From-SVN: r246381
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/ChangeLog | 5 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.oacc-c-c++-common/declare-vla.c | 25 |
2 files changed, 30 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index f63f028..74f50e0 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,8 @@ +2017-03-22 Cesar Philippidis <cesar@codesourcery.com> + + PR c++/80029 + * testsuite/libgomp.oacc-c-c++-common/declare-vla.c: New test. + 2017-03-08 Jakub Jelinek <jakub@redhat.com> PR c/79940 diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/declare-vla.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/declare-vla.c new file mode 100644 index 0000000..3ea148e --- /dev/null +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/declare-vla.c @@ -0,0 +1,25 @@ +/* Verify that acc declare accept VLA variables. */ + +#include <assert.h> + +int +main () +{ + int N = 1000; + int i, A[N]; +#pragma acc declare copy(A) + + for (i = 0; i < N; i++) + A[i] = -i; + +#pragma acc kernels + for (i = 0; i < N; i++) + A[i] = i; + +#pragma acc update host(A) + + for (i = 0; i < N; i++) + assert (A[i] == i); + + return 0; +} |