From: Cesar Philippidis Date: Tue, 5 Jun 2018 13:58:50 +0000 (-0700) Subject: re PR fortran/85701 ([openacc] ICE in mark_scope_block_unused, at tree-ssa-live.c... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ab44754ea2fd101fd3393e50a4d89135d691d32e;p=gcc.git re PR fortran/85701 ([openacc] ICE in mark_scope_block_unused, at tree-ssa-live.c:364) PR fortran/85701 gcc/fortran/ * openmp.c (gfc_resolve_oacc_declare): Error on functions and subroutine data clause arguments. gcc/testsuite/ * gfortran.dg/goacc/pr85701.f90: New test. From-SVN: r261202 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 079a306c451..23a40650583 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2018-06-05 Cesar Philippidis + + PR fortran/85701 + + * openmp.c (gfc_resolve_oacc_declare): Error on functions and + subroutine data clause arguments. + 2018-06-04 Steven G. Kargl PR fortran/85981 diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c index be80f8dea24..5c13312585a 100644 --- a/gcc/fortran/openmp.c +++ b/gcc/fortran/openmp.c @@ -5994,6 +5994,12 @@ gfc_resolve_oacc_declare (gfc_namespace *ns) for (n = oc->clauses->lists[list]; n; n = n->next) { n->sym->mark = 0; + if (n->sym->attr.function || n->sym->attr.subroutine) + { + gfc_error ("Object %qs is not a variable at %L", + n->sym->name, &oc->loc); + continue; + } if (n->sym->attr.flavor == FL_PARAMETER) { gfc_error ("PARAMETER object %qs is not allowed at %L", diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a049d14e886..83aef994748 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-06-05 Cesar Philippidis + + PR fortran/85701 + * gfortran.dg/goacc/pr85701.f90: New test. + 2018-06-05 Marek Polacek PR c++/85976 diff --git a/gcc/testsuite/gfortran.dg/goacc/pr85701.f90 b/gcc/testsuite/gfortran.dg/goacc/pr85701.f90 new file mode 100644 index 00000000000..9c201b865b2 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/goacc/pr85701.f90 @@ -0,0 +1,23 @@ +! PR fortran/85701 +! { dg-do compile } + +subroutine s1 + !$acc declare copy(s1) ! { dg-error "is not a variable" } +end + +subroutine s2 + !$acc declare present(s2) ! { dg-error "is not a variable" } +end + +function f1 () + !$acc declare copy(f1) ! { dg-error "is not a variable" } +end + +function f2 () + !$acc declare present(f2) ! { dg-error "is not a variable" } +end + +program p + !$acc declare copy(p) ! { dg-error "is not a variable" } +end +