aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJulian Brown <julian@codesourcery.com>2020-06-18 05:11:08 -0700
committerGiuliano Belinassi <giuliano.belinassi@usp.br>2020-08-17 13:19:51 -0300
commitd8b6ad4c1a59193583a01659fa8b0997cafcee76 (patch)
treedfc7310d262997fb24aa1928a668cbc5bb854cb3 /gcc
parentb583d3f8d6ad3c26f8efc5d7dbee9f9969a593a0 (diff)
downloadgcc-d8b6ad4c1a59193583a01659fa8b0997cafcee76.zip
gcc-d8b6ad4c1a59193583a01659fa8b0997cafcee76.tar.gz
gcc-d8b6ad4c1a59193583a01659fa8b0997cafcee76.tar.bz2
openacc: Deep copy attach/detach should not affect reference counts
Attach and detach operations are not supposed to affect structural or dynamic reference counts for OpenACC. Previously they did so, which led to subtle problems in some circumstances. We can avoid reference-counting attach/detach operations by extending and slightly repurposing the do_detach field in target_var_desc. It is now called is_attach to better reflect its new role. 2020-07-27 Julian Brown <julian@codesourcery.com> Thomas Schwinge <thomas@codesourcery.com> libgomp/ * libgomp.h (struct target_var_desc): Rename do_detach field to is_attach. * oacc-mem.c (goacc_exit_datum_1): Add assert. Don't set finalize for GOMP_MAP_FORCE_DETACH. Update checking to use is_attach field. (goacc_enter_data_internal): Don't affect reference counts for attach mappings. (goacc_exit_data_internal): Don't affect reference counts for detach mappings. * target.c (gomp_map_vars_existing): Don't affect reference counts for attach mappings. (gomp_map_vars_internal): Set renamed is_attach flag unconditionally to mark attach mappings. (gomp_unmap_vars_internal): Use is_attach flag to prevent affecting reference count for attach mappings. * testsuite/libgomp.oacc-c-c++-common/mdc-refcount-1.c: New test. * testsuite/libgomp.oacc-c-c++-common/mdc-refcount-2.c: New test. * testsuite/libgomp.oacc-c-c++-common/mdc-refcount-2.c: New test. * testsuite/libgomp.oacc-fortran/deep-copy-6-no_finalize.F90: Mark test as shouldfail. * testsuite/libgomp.oacc-fortran/deep-copy-6.f90: Adjust to fail gracefully in no-finalize mode. Co-Authored-By: Thomas Schwinge <thomas@codesourcery.com>
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions