aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/openmp.c
diff options
context:
space:
mode:
authorAndrew Stubbs <ams@codesourcery.com>2019-07-05 16:00:46 +0000
committerAndrew Stubbs <ams@gcc.gnu.org>2019-07-05 16:00:46 +0000
commit6e158c5fd534a1080dd013ed5d9d3fcc3fe838ff (patch)
treee316b968a1a94d1bc6e61aa2a8afdd37b7d5544b /gcc/fortran/openmp.c
parent899a199767a1a94812bed0642eca3da0c96c9355 (diff)
downloadgcc-6e158c5fd534a1080dd013ed5d9d3fcc3fe838ff.zip
gcc-6e158c5fd534a1080dd013ed5d9d3fcc3fe838ff.tar.gz
gcc-6e158c5fd534a1080dd013ed5d9d3fcc3fe838ff.tar.bz2
Tweak error message for mapped parameters.
2019-07-05 Andrew Stubbs <ams@codesourcery.com> gcc/fortran/ * openmp.c (resolve_omp_clauses): Add custom error messages for parameters in map clauses. From-SVN: r273143
Diffstat (limited to 'gcc/fortran/openmp.c')
-rw-r--r--gcc/fortran/openmp.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c
index 1c7bce6..44fcb9d 100644
--- a/gcc/fortran/openmp.c
+++ b/gcc/fortran/openmp.c
@@ -4208,8 +4208,21 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses,
continue;
}
}
- gfc_error ("Object %qs is not a variable at %L", n->sym->name,
- &n->where);
+ if (list == OMP_LIST_MAP
+ && n->sym->attr.flavor == FL_PARAMETER)
+ {
+ if (openacc)
+ gfc_error ("Object %qs is not a variable at %L; parameters"
+ " cannot be and need not be copied", n->sym->name,
+ &n->where);
+ else
+ gfc_error ("Object %qs is not a variable at %L; parameters"
+ " cannot be and need not be mapped", n->sym->name,
+ &n->where);
+ }
+ else
+ gfc_error ("Object %qs is not a variable at %L", n->sym->name,
+ &n->where);
}
for (list = 0; list < OMP_LIST_NUM; list++)