https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127174
Bug ID: 127174
Summary: [OpenMP] declare target does not check for invalid
'device_type'
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Keywords: accepts-invalid, diagnostic, openmp
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: burnus at gcc dot gnu.org
CC: cltang at gcc dot gnu.org
Target Milestone: ---
The following is invalid:
int x;
#pragma omp declare target enter(x) device_type(nohost)
#pragma omp declare target enter(x) device_type(host)
#pragma omp declare target enter(x) device_type(any)
While there is a check that there is only a single 'device_type' clause per
directive, there is no check that a following 'declare target' for the same
variable/function only re-specifies the same device type as before.
In addition, currently:
#pragma omp declare target enter(x) device_type(any)
and
#pragma omp declare target enter(x)
produce different code (different attributes) even though OpenMP states that
they are identical!
This is a C and C++ issue. [Fortran already checks for this (and handles 'any'
and not specified identical).]