diff options
author | Thomas Schwinge <thomas@codesourcery.com> | 2019-03-21 21:13:44 +0100 |
---|---|---|
committer | Thomas Schwinge <tschwinge@gcc.gnu.org> | 2019-03-21 21:13:44 +0100 |
commit | 2e4182ae07e16f30b8917af3c0581a6c8af31357 (patch) | |
tree | 5742c92f31f9bcc01fcd42222b7d0761eda5f2c9 /gcc/fortran/openmp.c | |
parent | f6bf4bc14d8ab24acad0b0d42cde5e08d1c3a879 (diff) | |
download | gcc-2e4182ae07e16f30b8917af3c0581a6c8af31357.zip gcc-2e4182ae07e16f30b8917af3c0581a6c8af31357.tar.gz gcc-2e4182ae07e16f30b8917af3c0581a6c8af31357.tar.bz2 |
[PR72741] Properly handle clauses specifying the level of parallelism for 'external' Fortran OpenACC routines
..., so as to also for these enable the generic middle end OMP code to verify
proper nesting of loops/routines regarding their levels of parallelism.
gcc/fortran/
PR fortran/72741
* openmp.c (gfc_match_oacc_routine): Set the level of parallelism
for all variants.
(gfc_resolve_oacc_routines): Call gfc_add_omp_declare_target.
gcc/testsuite/
PR fortran/72741
* c-c++-common/goacc/routine-3-extern.c: New file.
* c-c++-common/goacc/routine-3.c: Adjust.
* c-c++-common/goacc/routine-4-extern.c: New file.
* c-c++-common/goacc/routine-4.c: Adjust.
* gfortran.dg/goacc/routine-module-3.f90: New file.
* gfortran.dg/goacc/routine-external-level-of-parallelism-1.f: New
file.
* gfortran.dg/goacc/routine-external-level-of-parallelism-2.f:
Likewise.
Co-Authored-By: Cesar Philippidis <cesar@codesourcery.com>
From-SVN: r269858
Diffstat (limited to 'gcc/fortran/openmp.c')
-rw-r--r-- | gcc/fortran/openmp.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c index 983b83d..9fc2367 100644 --- a/gcc/fortran/openmp.c +++ b/gcc/fortran/openmp.c @@ -2391,6 +2391,8 @@ gfc_match_oacc_routine (void) if (add) { + sym->attr.oacc_routine_lop = lop; + n = gfc_get_oacc_routine_name (); n->sym = sym; n->clauses = c; @@ -6085,6 +6087,12 @@ gfc_resolve_oacc_routines (gfc_namespace *ns) " in !$ACC ROUTINE ( NAME ) at %L", sym->name, &orn->loc); continue; } + if (!gfc_add_omp_declare_target (&sym->attr, sym->name, &orn->loc)) + { + gfc_error ("NAME %qs invalid" + " in !$ACC ROUTINE ( NAME ) at %L", sym->name, &orn->loc); + continue; + } } } |