diff options
| author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-04-03 21:01:26 +0000 |
|---|---|---|
| committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-04-03 21:01:26 +0000 |
| commit | 23632bd1fcc6919244bb1fc5a19cde87feff5a08 (patch) | |
| tree | 02b953d9998d526e71e6468cb7fbc7b9f9826267 /gcc/fortran/openmp.c | |
| parent | e0d72b883779eb23ef609c5b0b5cd5964ffb9cbb (diff) | |
| download | ppe42-gcc-23632bd1fcc6919244bb1fc5a19cde87feff5a08.tar.gz ppe42-gcc-23632bd1fcc6919244bb1fc5a19cde87feff5a08.zip | |
PR fortran/35786
* openmp.c (resolve_omp_clauses): Diagnose if a clause symbol
isn't a variable.
* gfortran.dg/gomp/pr35786-1.f90: New test.
* gfortran.dg/gomp/pr35786-2.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@133874 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/openmp.c')
| -rw-r--r-- | gcc/fortran/openmp.c | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c index 8c2d2577440..245f7951ddc 100644 --- a/gcc/fortran/openmp.c +++ b/gcc/fortran/openmp.c @@ -717,7 +717,41 @@ resolve_omp_clauses (gfc_code *code) a symbol can appear on both firstprivate and lastprivate. */ for (list = 0; list < OMP_LIST_NUM; list++) for (n = omp_clauses->lists[list]; n; n = n->next) - n->sym->mark = 0; + { + n->sym->mark = 0; + if (n->sym->attr.flavor == FL_VARIABLE) + continue; + if (n->sym->attr.flavor == FL_PROCEDURE + && n->sym->result == n->sym + && n->sym->attr.function) + { + if (gfc_current_ns->proc_name == n->sym + || (gfc_current_ns->parent + && gfc_current_ns->parent->proc_name == n->sym)) + continue; + if (gfc_current_ns->proc_name->attr.entry_master) + { + gfc_entry_list *el = gfc_current_ns->entries; + for (; el; el = el->next) + if (el->sym == n->sym) + break; + if (el) + continue; + } + if (gfc_current_ns->parent + && gfc_current_ns->parent->proc_name->attr.entry_master) + { + gfc_entry_list *el = gfc_current_ns->parent->entries; + for (; el; el = el->next) + if (el->sym == n->sym) + break; + if (el) + continue; + } + } + gfc_error ("Object '%s' is not a variable at %L", n->sym->name, + &code->loc); + } for (list = 0; list < OMP_LIST_NUM; list++) if (list != OMP_LIST_FIRSTPRIVATE && list != OMP_LIST_LASTPRIVATE) |

