Hi! On 2020-05-20T11:37:35+0200, I wrote: > Moving this over, from the "Fix component mappings with derived types for > OpenACC" thread, > , where > you propose to change this 'GOMP_MAP_STRUCT' handling code: > > On 2019-12-17T22:03:47-0800, Julian Brown wrote: >> --- a/libgomp/oacc-mem.c >> +++ b/libgomp/oacc-mem.c > >> @@ -1075,6 +1119,39 @@ goacc_exit_data_internal (struct gomp_device_descr *acc_dev, size_t mapnum, >> gomp_remove_var_async (acc_dev, n, aq); >> } >> break; >> + >> + case GOMP_MAP_STRUCT: >> + { >> + int elems = sizes[i]; >> + for (int j = 1; j <= elems; j++) >> + { >> + struct splay_tree_key_s k; >> + k.host_start = (uintptr_t) hostaddrs[i + j]; >> + k.host_end = k.host_start + sizes[i + j]; >> + splay_tree_key str; >> + str = splay_tree_lookup (&acc_dev->mem_map, &k); >> + if (str) >> + { >> + if (finalize) >> + { >> + str->refcount -= str->virtual_refcount; >> + str->virtual_refcount = 0; >> + } >> + if (str->virtual_refcount > 0) >> + { >> + str->refcount--; >> + str->virtual_refcount--; >> + } >> + else if (str->refcount > 0) >> + str->refcount--; >> + if (str->refcount == 0) >> + gomp_remove_var_async (acc_dev, str, aq); >> + } >> + } >> + i += elems; >> + } >> + break; >> + >> default: >> gomp_fatal (">>>> goacc_exit_data_internal UNHANDLED kind 0x%.2x", >> kind); > > ... into an "empty 'case GOMP_MAP_STRUCT:' as a no-op [...] > I suppose we still need to unmap the "'GOMP_MAP_STRUCT' components", but > can do that individually, outside of the 'GOMP_MAP_STRUCT' context. You've answered my question with the patch submission; I've now pushed "[OpenACC 'exit data'] Simplify 'GOMP_MAP_STRUCT' handling" to master branch in commit 1809628fcff6f512206efd0ae03a3faccc4096f2, and releases/gcc-10 branch in commit 96d8d068f3d6f3efebdca65f0a7b86e0609ee66f, see attached. Grüße Thomas ----------------- Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter