aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Stubbs <ams@codesourcery.com>2019-07-05 16:00:46 +0000
committerThomas Schwinge <thomas@codesourcery.com>2020-03-03 12:50:59 +0100
commitd73fe949b361a6aa40abc78a86413e5169ab0f4e (patch)
treec72c586d8cbc43d0df62d4ada5d512a7f7da1044
parent14fbd2f51029fd2ce4537c88433b8c3eeffe9b44 (diff)
downloadgcc-d73fe949b361a6aa40abc78a86413e5169ab0f4e.zip
gcc-d73fe949b361a6aa40abc78a86413e5169ab0f4e.tar.gz
gcc-d73fe949b361a6aa40abc78a86413e5169ab0f4e.tar.bz2
Tweak error message for mapped parameters.
2019-09-06 Andrew Stubbs <ams@codesourcery.com> Backport from mainline: 2019-07-05 Andrew Stubbs <ams@codesourcery.com> gcc/fortran/ * openmp.c (resolve_omp_clauses): Add custom error messages for parameters in map clauses. (cherry picked from openacc-gcc-9-branch commit 7ed5fa7ae91f1c504d7c1b750a10647b27fdf954)
-rw-r--r--gcc/fortran/ChangeLog.omp9
-rw-r--r--gcc/fortran/openmp.c17
2 files changed, 24 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog.omp b/gcc/fortran/ChangeLog.omp
index c8456e4..576e33f 100644
--- a/gcc/fortran/ChangeLog.omp
+++ b/gcc/fortran/ChangeLog.omp
@@ -1,3 +1,12 @@
+2019-09-06 Andrew Stubbs <ams@codesourcery.com>
+
+ Backport from mainline:
+
+ 2019-07-05 Andrew Stubbs <ams@codesourcery.com>
+
+ * openmp.c (resolve_omp_clauses): Add custom error messages for
+ parameters in map clauses.
+
2019-07-10 Julian Brown <julian@codesourcery.com>
* trans-openmp.c (gfc_omp_finish_clause): Change clauses mapping
diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c
index adf8d42..fa0cd6f 100644
--- a/gcc/fortran/openmp.c
+++ b/gcc/fortran/openmp.c
@@ -4279,8 +4279,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++)