Skip to content
Snippets Groups Projects
Commit 96246bff authored by Sandra Loosemore's avatar Sandra Loosemore
Browse files

OpenMP: Check additional restrictions on context selector properties

TR13 (pre-6.0) of the OpenMP spec says:

"Each trait-property may only be specified once in a trait selector
other than those in the construct selector set."

and

"If trait-property any is specified in the kind trait-selector of the
device selector set or the target_device selector sets, no other
trait-property may be specified in the same selector set."

These restrictions (with slightly different wording) date back to
OpenMP 5.1, but were not in 5.0 which was the basis for GCC's
implementation.

This patch adds a diagnostic, adds new testcases, and fixes some older
testcases that include now-invalid selectors.

gcc/ChangeLog
	* omp-general.cc (omp_check_context_selector): Reject other
	properties in the same selector set with kind(any).  Also reject
	duplicate name-list properties.

gcc/testsuite/ChangeLog
	* c-c++-common/gomp/declare-variant-10.c: Fix broken tests.
	* c-c++-common/gomp/declare-variant-3.c: Likewise.
	* c-c++-common/gomp/declare-variant-9.c: Likewise.
	* c-c++-common/gomp/declare-variant-any.c: New.
	* c-c++-common/gomp/declare-variant-duplicates.c: New.
	* gfortran.dg/gomp/declare-variant-10.f90: Fix broken tests.
	* gfortran.dg/gomp/declare-variant-3.f90: Likewise.
	* gfortran.dg/gomp/declare-variant-9.f90: Likewise.
	* gfortran.dg/gomp/declare-variant-any.f90: New.
	* gfortran.dg/gomp/declare-variant-duplicates.f90: New.
parent 2114243c
No related branches found
No related tags found
Loading
Showing
with 176 additions and 24 deletions
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