gcc/libgomp/testsuite
Julian Brown bc4ed079dc 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>
2020-07-27 09:16:57 -07:00
..
config Update copyright years. 2020-01-01 12:51:42 +01:00
lib handle dumpbase in offloading, adjust testsuite 2020-06-23 06:31:18 -03:00
libgomp.c x86-64: Define ASM_OUTPUT_ALIGNED_DECL_LOCAL 2020-07-18 08:51:54 -07:00
libgomp.c-c++-common critical-hint-*.{c,f90}: Move from gcc/testsuite to libgomp/testsuite 2020-07-22 12:14:22 +02:00
libgomp.c++ c++: Change the default dialect to C++17. 2020-06-26 15:29:07 -04:00
libgomp.fortran critical-hint-*.{c,f90}: Move from gcc/testsuite to libgomp/testsuite 2020-07-22 12:14:22 +02:00
libgomp.graphite Update copyright years. 2020-01-01 12:51:42 +01:00
libgomp.hsa.c libgomp – spelling fixes, incl. omp_lib.h.in 2019-12-11 12:45:49 +01:00
libgomp.oacc-c [testsuite] Unset 'offload_target' after use 2020-07-24 14:00:43 +02:00
libgomp.oacc-c-c++-common openacc: Deep copy attach/detach should not affect reference counts 2020-07-27 09:16:57 -07:00
libgomp.oacc-c++ [testsuite] Unset 'offload_target' after use 2020-07-24 14:00:43 +02:00
libgomp.oacc-fortran openacc: Deep copy attach/detach should not affect reference counts 2020-07-27 09:16:57 -07:00
libgomp-site-extra.exp.in libgomp/test: Remove a build sysroot fix regression 2020-04-06 23:32:45 +01:00
libgomp-test-support.exp.in libgomp/test: Remove a build sysroot fix regression 2020-04-06 23:32:45 +01:00
Makefile.am libgomp/test: Remove a build sysroot fix regression 2020-04-06 23:32:45 +01:00
Makefile.in libomp: Add omp_depend_kind to omp_lib.{f90,h} 2020-07-23 15:02:15 +02:00