https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108545
--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Fortran: Same issue (ICE) also with:
!$omp target enter data map(to: x)
Crucial is the VOLATILE attribute.
* * *
The following C code already gives an ICE with GCC 12, it works with GCC 11.
(Either of the two lines fail. I think that's invalid OpenMP code, but
I do not have a real overview about 'map' - and I fear no one has.)
volatile struct t {
struct t2 { int *a; int c; } u;
int b;
} my_struct;
volatile struct t3 { int *a; int c; } my_struct3;
void f() {
#pragma omp target enter data map(to:my_struct.u) map(to:my_struct.u.a)
#pragma omp target enter data map(to:my_struct3) map(to:my_struct3.a)
}