Skip to content
Snippets Groups Projects
Commit fcff9c3d authored by Tobias Burnus's avatar Tobias Burnus
Browse files

OpenMP: Update OMP_REQUIRES_TARGET_USED for declare_target + interop

Older versions of the OpenMP specification were not clear about what counted
as device usage. Newer (like TR13) are rather clear. Hence, this commit adds
GCC's target-used flag also when a 'declare target' or an 'interop' are
encountered.  (The latter only to Fortran as C/C++ parsing support is still
missing.) TR13 also lists 'dispatch' as target-used construct (as it has the
device clause) and 'device_safesync' as clause with global requirement
property, but both are not yet supported in GCC.

gcc/c/ChangeLog:

	* c-parser.cc (c_parser_omp_declare_target): Set target-used bit
	in omp_requires_mask.

gcc/cp/ChangeLog:

	* parser.cc (cp_parser_omp_declare_target): Set target-used bit
	in omp_requires_mask.

gcc/fortran/ChangeLog:

	* parse.cc (decode_omp_directive): Set target-used bit of
	omp_requires_mask when encountering the declare_target or interop
	directive.

gcc/testsuite/ChangeLog:

	* gfortran.dg/gomp/interop-1.f90: Add dg-error for missing
	omp requires requirement and declare_variant usage.
	* gfortran.dg/gomp/requires-8.f90: Likewise.
parent 5d87b98a
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment