https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113004
Bug ID: 113004 Summary: OpenMP 5 - structs are not mapped element-wise by default Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: jules at gcc dot gnu.org Target Milestone: --- According to e.g. OpenMP 5.2, "5.8.2 Mapper Identifiers and mapper Modifiers": "A structure type T has a predefined default mapper that is defined as if by a declare mapper directive that specifies v in a map clause with the alloc map-type and each structure element of v in a map clause with the tofrom map-type." At present, a variable of struct type will be mapped as as a single block (the pre-OpenMP 5.0 legacy behaviour). This works fine most of the time, but for example fails in the case where one of the struct's members is a reference, demonstrated in the test case: libgomp/testsuite/libgomp.c++/target-49.C Once "declare mapper" support is committed, cases where a struct with an implicit default mapper should invoke a struct with a *non*-default mapper, will also probably be mishandled.