openmp: Diagnose using grainsize+num_tasks clauses together [PR115103]
commit7fdbefc575c24881356b5f4091fa57b5f7166a90
authorJakub Jelinek <jakub@redhat.com>
Wed, 15 May 2024 16:34:44 +0000 (15 18:34 +0200)
committerJakub Jelinek <jakub@redhat.com>
Wed, 15 May 2024 16:34:44 +0000 (15 18:34 +0200)
tree4826d2acd9a6987fc1532fc9bb125bb50d17a275
parent99b1daae18c095d6c94d32efb77442838e11cbfb
openmp: Diagnose using grainsize+num_tasks clauses together [PR115103]

I've noticed that while we diagnose many other OpenMP exclusive clauses,
we don't diagnose grainsize together with num_tasks on taskloop construct
in all of C, C++ and Fortran (the implementation simply ignored grainsize
in that case) and for Fortran also don't diagnose mixing nogroup clause
with reduction clause(s).

Fixed thusly.

2024-05-15  Jakub Jelinek  <jakub@redhat.com>

PR c/115103
gcc/c/
* c-typeck.cc (c_finish_omp_clauses): Diagnose grainsize
used together with num_tasks.
gcc/cp/
* semantics.cc (finish_omp_clauses): Diagnose grainsize
used together with num_tasks.
gcc/fortran/
* openmp.cc (resolve_omp_clauses): Diagnose grainsize
used together with num_tasks or nogroup used together with
reduction.
gcc/testsuite/
* c-c++-common/gomp/clause-dups-1.c: Add 2 further expected errors.
* gfortran.dg/gomp/pr115103.f90: New test.
gcc/c/c-typeck.cc
gcc/cp/semantics.cc
gcc/fortran/openmp.cc
gcc/testsuite/c-c++-common/gomp/clause-dups-1.c
gcc/testsuite/gfortran.dg/gomp/pr115103.f90 [new file with mode: 0644]