summaryrefslogtreecommitdiffstats
path: root/gcc/fortran
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-03 21:01:26 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-03 21:01:26 +0000
commit23632bd1fcc6919244bb1fc5a19cde87feff5a08 (patch)
tree02b953d9998d526e71e6468cb7fbc7b9f9826267 /gcc/fortran
parente0d72b883779eb23ef609c5b0b5cd5964ffb9cbb (diff)
downloadppe42-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')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/openmp.c36
2 files changed, 41 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 5a6971fa5bb..851008ed395 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2008-04-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/35786
+ * openmp.c (resolve_omp_clauses): Diagnose if a clause symbol
+ isn't a variable.
+
2008-04-03 Tom Tromey <tromey@redhat.com>
* Make-lang.in (fortran_OBJS): New variable.
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)
OpenPOWER on IntegriCloud