aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/dump-parse-tree.cc
diff options
context:
space:
mode:
authorSandra Loosemore <sandra@codesourcery.com>2022-01-20 13:29:48 -0800
committerSandra Loosemore <sandra@codesourcery.com>2022-01-20 13:29:48 -0800
commitd2ad748eeef0dd260f3993b8dcbffbded3240a0a (patch)
treeccc475f58a559c1f528b3fef13530640b18160c3 /gcc/fortran/dump-parse-tree.cc
parentcc01cd9397fe99e707bcc5b98bb33d807ba610d7 (diff)
downloadgcc-d2ad748eeef0dd260f3993b8dcbffbded3240a0a.zip
gcc-d2ad748eeef0dd260f3993b8dcbffbded3240a0a.tar.gz
gcc-d2ad748eeef0dd260f3993b8dcbffbded3240a0a.tar.bz2
Fortran: Fix scope for OMP AFFINITY clause iterator variables [PR103695]
gfc_finish_var_decl was confused by the undocumented overloading of the proc_name field in struct gfc_namespace to contain iterator variables for the OpenMP AFFINITY clause, causing it to insert the decls in the wrong scope. This patch adds a new distinct field to hold these variables. 2022-01-20 Sandra Loosemore <sandra@codesourcery.com> PR fortran/103695 PR fortran/102621 gcc/fortran * gfortran.h (struct gfc_namespace) Add omp_affinity_iterator field. * dump-parse-tree.cc (show_iterator): Use it. * openmp.cc (gfc_match_iterator): Likewise. (resolve_omp_clauses): Likewise. * trans-decl.cc (gfc_finish_var_decl): Likewise. * trans-openmp.cc (handle_iterator): Likewise. gcc/testsuite/ * gfortran.dg/gomp/affinity-clause-3.f90: Adjust pattern. * gfortran.dg/gomp/pr102621.f90: New. * gfortran.dg/gomp/pr103695.f90: New.
Diffstat (limited to 'gcc/fortran/dump-parse-tree.cc')
-rw-r--r--gcc/fortran/dump-parse-tree.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/fortran/dump-parse-tree.cc b/gcc/fortran/dump-parse-tree.cc
index a618ae2..3112cae 100644
--- a/gcc/fortran/dump-parse-tree.cc
+++ b/gcc/fortran/dump-parse-tree.cc
@@ -1302,10 +1302,10 @@ show_code (int level, gfc_code *c)
static void
show_iterator (gfc_namespace *ns)
{
- for (gfc_symbol *sym = ns->proc_name; sym; sym = sym->tlink)
+ for (gfc_symbol *sym = ns->omp_affinity_iterators; sym; sym = sym->tlink)
{
gfc_constructor *c;
- if (sym != ns->proc_name)
+ if (sym != ns->omp_affinity_iterators)
fputc (',', dumpfile);
fputs (sym->name, dumpfile);
fputc ('=', dumpfile);