From: Cesar Philippidis Date: Thu, 21 Sep 2017 13:59:26 +0000 (-0700) Subject: openmp.c (gfc_match_oacc_wait): Don't restrict wait directive arguments to constant... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a0e27dc2aa25c98e15e109b2915545dfbe21f27f;p=gcc.git openmp.c (gfc_match_oacc_wait): Don't restrict wait directive arguments to constant integers. gcc/fortran/ * openmp.c (gfc_match_oacc_wait): Don't restrict wait directive arguments to constant integers. gcc/testsuite/ * gfortran.dg/goacc/wait.f90: New test. From-SVN: r253071 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index b6abf24e2f1..4dac286aaeb 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2017-09-21 Cesar Philippidis + + * openmp.c (gfc_match_oacc_wait): Don't restrict wait directive + arguments to constant integers. + 2017-09-17 Paul Thomas PR fortran/82173 diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c index 8400354181c..c5e00888bbe 100644 --- a/gcc/fortran/openmp.c +++ b/gcc/fortran/openmp.c @@ -2185,8 +2185,7 @@ gfc_match_oacc_wait (void) } if (!gfc_resolve_expr (el->expr) - || el->expr->ts.type != BT_INTEGER || el->expr->rank != 0 - || el->expr->expr_type != EXPR_CONSTANT) + || el->expr->ts.type != BT_INTEGER || el->expr->rank != 0) { gfc_error ("WAIT clause at %L requires a scalar INTEGER expression", &el->expr->where); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1c241b921da..1ea22ee833d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2017-09-21 Cesar Philippidis + + * gfortran.dg/goacc/wait.f90: New test. + 2017-09-21 Jakub Jelinek PR sanitizer/81715 diff --git a/gcc/testsuite/gfortran.dg/goacc/wait.f90 b/gcc/testsuite/gfortran.dg/goacc/wait.f90 new file mode 100644 index 00000000000..9cdbcdf822e --- /dev/null +++ b/gcc/testsuite/gfortran.dg/goacc/wait.f90 @@ -0,0 +1,12 @@ +! Ensure that ACC WAIT accept integer arguments. + +subroutine foo (wqueue) + implicit none + integer :: wqueue, waitno + integer, parameter :: waitp = 100 + + !$acc wait (wqueue) + !$acc wait (waitno) + !$acc wait (waitp) + !$acc wait (0) +end subroutine foo