Hi Thomas, hi all, (Updated patch attached – only changes the goacc testcases. I intent to commit the patch tomorrow, unless more comments come up.) On 10.03.22 10:00, Thomas Schwinge wrote: [OpenACC testcases:] > I recently added that checking in ... [...] to document the status quo. > (1), as you have proposed, add '-O0' (but with source code comment, please); [...] > ..., or (2): update the test cases [...] (rationale: the test cases > haven't originally been written for the '-Wuninitialized' diagnostics; [...] > (3): duplicate the test cases to account for both (1) and (2) > [...] (3), would be my approach. Attached patch does (3). I also remove the code tweaking, added in previous patch. - But added a bunch of comments. And I have to admit that I did not realize that the -Wuninitialized was only added later. (I did not expect that new flags get added to existing patches.) >> ** I am actually not sure whether 'acc update(b)' will/should map a >> previous allocated variable - or whether it should. [...] >> testcases. Should be: "previously *un*allocated" (+ Thomas s%...%.. comments). > I don't quickly dig that, sorry. Do we need to first clarify that with > OpenACC Technical Committee, or is this just a GCC/OpenACC implementation > issue? That's mostly an OpenACC spec question. But I did not check what the spec says. Thus, I don't know * whether the spec needs to be improved * what the implications are on the implementation. I assume that the implementation for OpenMP does also make sense for OpenACC (i.e. either works as required or does more but in a sensible way) - but I don't know. I think either/both of us should check the OpenACC spec. * * * On the OpenMP side (clarified in 5.1 or 5.2): * Map first an unallocated allocatable => That one is regarded as mapped/present * Allocate it and map it again (e.g. implicit/explicit mapping for a target region) => Spec: Implementation may or may not update the item. However, (only) with 'always' the spec guarantees that it will also show up as allocated on the device. => Sentiment: should also work without 'always' modifier if previously unallocated. (Discussion postponed.) * I have not checked 'update' but I think it behaves like 'map(always,to/from:' (except for ref counting) OpenMP GCC implementation: there is a known issue for scalar allocatables (PR96668). It does work for arrays (also without 'always') - and 'omp update' has not been checked. (Ref counting issues?) OpenACC GCC implementation: I think this code is shared with OpenMP and, thus, works likewise. But I have have also not checked this. Tobias ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955