This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 2/3] Don't allow mixed component and non-component accesses for OpenACC/Fortran
- From: Tobias Burnus <tobias at codesourcery dot com>
- To: Julian Brown <julian at codesourcery dot com>, <gcc-patches at gcc dot gnu dot org>
- Cc: <fortran at gcc dot gnu dot org>, <tobias at codesourcery dot com>, Thomas Schwinge <thomas at codesourcery dot com>, Jakub Jelinek <jakub at redhat dot com>
- Date: Tue, 7 Jan 2020 11:21:38 +0100
- Subject: Re: [PATCH 2/3] Don't allow mixed component and non-component accesses for OpenACC/Fortran
- Ironport-sdr: N9TVwYEfuAWUeXwJ2uSaB1GvqxjwgmaMpzt1XRuRSKE/oiwxtMA1Aiq8IC7AWiyNpo1DKZda9H mVaXj1ODD1m/fGi02C2bdyzls2kOOx6pFJo0qVKPBGCnI2yBlZHnvGNky0adHEJEHG/2Vpy62t Sd/w3E8t+EhrIvGIiQDQKsVFfBkGMdXaAQnWP2eAZjS7rr6/MLOxBYZaVxH93VSyrSq8pwlXN2 1lguIakOKTrAxaIbgL+JbS+WnfS40dpF0vxOuoCARTUqYh2QxHfGdNq/+ikftieYYAGEVY8OXw xyo=
- Ironport-sdr: 5/vGDIMMnC48wcAqh8Y6kvqmyX1LtnNzLcrMAUPVh9b1MrIy25nL+zwlXbwL3MtSZ/2RsU5zZb EcDv1R9guVZuuKeFEE0f0z0jNEsONQBy94l8GWcvalOf1iKhPHqvTMceadf6tXkaICJRqj/d0Z RSC7oRvGgiOh+6Q/sjFgRn7+goUracNTJ+Z+BpnLK+kDk/0ESDv82T9DNadQhcrIYF/nnhw2ES QRkIZYpUkV+FBhtH+2+OMB+DEWKzTayPo0fFzYOqo6h9fZuyfwIOoUN2xkYkyjsFunx3raMpdT Vro=
- References: <20200104022514.115942-1-julian@codesourcery.com> <20200104022514.115942-2-julian@codesourcery.com>
Hi Julian,
please hold back the commit.
Actually, it does not seem to work if one modifies the test
case a bit. The following code compiles – but I think it
should not:
type one
integer i, j
end type
type two
type(one) A, B
end type
type(two) x
!$acc enter data copyin(x%A, x%A%i)
!$acc enter data copyin(x%A, x%A%i, x%A%i)
end
At least the last line has x%A%i twice but it is accepted.
I am not sure whether the line before is valid or not
(x%A%i is copied twice; might make a difference if it were
a pointer but it isn't a pointer here.) – In C/C++, with OpenMP
and, hence, OpenACC, the first one is accepted but the second
one is rejected. C example:
struct one {
int i, j;
};
struct two {
struct one A, B;
};
void foo() {
struct two x;
/* Accepted: x.A + x.A.i, even though both map 'x.A.i'. */
#pragma omp target enter data map(to:x.A, x.A.i)
#pragma acc enter data copyin(x.A, x.A.i)
/* Rejected: 'x.A.i' mapped twice */
#pragma omp target enter data map(to:x.A, x.A.i, x.A.i)
#pragma acc enter data copyin(x.A, x.A.i, x.A.i)
}
Tobias