aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorJulian Brown <julian@codesourcery.com>2025-04-23 00:01:43 +0000
committerSandra Loosemore <sloosemore@baylibre.com>2025-05-15 20:25:49 +0000
commit3ea1f835c3775431634ffe1ad44b0c742664a3dd (patch)
tree39fc926f8aeccc81bb78e1a1594c27d4907a11e6 /gcc/c
parent7affa61f67813b86206db027b981b165bccb84b7 (diff)
downloadgcc-3ea1f835c3775431634ffe1ad44b0c742664a3dd.zip
gcc-3ea1f835c3775431634ffe1ad44b0c742664a3dd.tar.gz
gcc-3ea1f835c3775431634ffe1ad44b0c742664a3dd.tar.bz2
OpenMP: Look up 'declare mapper' definitions at resolution time not parse time
This patch moves 'declare mapper' lookup for OpenMP clauses from parse time to resolution time for Fortran, and adds diagnostics for missing named mappers. This changes clause lookup in a particular case -- where several 'declare mapper's are defined in a context, mappers declared earlier may now instantiate mappers declared later, whereas previously they would not. I think the new behaviour makes more sense -- at an invocation site, all mappers are visible no matter the declaration order in some particular block. I've adjusted tests to account for this. I think the new arrangement better matches the Fortran FE's usual way of doing things -- mapper lookup is a semantic concept, not a syntactical one, so shouldn't be handled in the syntax-handling code. The patch also fixes a case where the user explicitly writes 'default' as the name on the mapper modifier for a clause. 2023-08-10 Julian Brown <julian@codesourcery.com> gcc/fortran/ * gfortran.h (gfc_omp_namelist_udm): Add MAPPER_ID field to store the mapper name to use for lookup during resolution. * match.cc (gfc_free_omp_namelist): Handle OMP_LIST_TO and OMP_LIST_FROM when freeing mapper references. * module.cc (load_omp_udms, write_omp_udm): Handle MAPPER_ID field. * openmp.cc (gfc_match_omp_clauses): Handle explicitly-specified 'default' name. Don't do mapper lookup here, but record mapper name if the user specifies one. (resolve_omp_clauses): Do mapper lookup here instead. Report error for missing named mapper. gcc/testsuite/ * gfortran.dg/gomp/declare-mapper-31.f90: New test. libgomp/ * testsuite/libgomp.fortran/declare-mapper-30.f90: New test. * testsuite/libgomp.fortran/declare-mapper-4.f90: Adjust test for new lookup behaviour.
Diffstat (limited to 'gcc/c')
0 files changed, 0 insertions, 0 deletions