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
This commit is contained in:
Cesar Philippidis 2018-06-05 06:58:50 -07:00 committed by Cesar Philippidis
parent f115c9b536
commit ab44754ea2
4 changed files with 41 additions and 0 deletions

View file

@ -1,3 +1,10 @@
2018-06-05 Cesar Philippidis <cesar@codesourcery.com>
PR fortran/85701
* openmp.c (gfc_resolve_oacc_declare): Error on functions and
subroutine data clause arguments.
2018-06-04 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/85981

View file

@ -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",

View file

@ -1,3 +1,8 @@
2018-06-05 Cesar Philippidis <cesar@codesourcery.com>
PR fortran/85701
* gfortran.dg/goacc/pr85701.f90: New test.
2018-06-05 Marek Polacek <polacek@redhat.com>
PR c++/85976

View file

@ -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