openmp.c (gfc_match_oacc_wait): Don't restrict wait directive arguments to constant...
authorCesar Philippidis <cesar@codesourcery.com>
Thu, 21 Sep 2017 13:59:26 +0000 (06:59 -0700)
committerCesar Philippidis <cesar@gcc.gnu.org>
Thu, 21 Sep 2017 13:59:26 +0000 (06:59 -0700)
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

gcc/fortran/ChangeLog
gcc/fortran/openmp.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/goacc/wait.f90 [new file with mode: 0644]

index b6abf24e2f196a565527d252a03d68d01e2cb1d1..4dac286aaeba03ad70b03964526e079f5ed00b5f 100644 (file)
@@ -1,3 +1,8 @@
+2017-09-21  Cesar Philippidis  <cesar@codesourcery.com>
+
+       * openmp.c (gfc_match_oacc_wait): Don't restrict wait directive
+       arguments to constant integers.
+
 2017-09-17  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/82173
index 8400354181c2b9ae18965366f81928f5f4c736a1..c5e00888bbecb7792bdc0bac6350d069dedc37fc 100644 (file)
@@ -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);
index 1c241b921daf53ffd82ec5be1ca302079a658ac3..1ea22ee833d0bc020cafbed01c43b601834c2805 100644 (file)
@@ -1,3 +1,7 @@
+2017-09-21  Cesar Philippidis  <cesar@codesourcery.com>
+
+       * gfortran.dg/goacc/wait.f90: New test.
+
 2017-09-21  Jakub Jelinek  <jakub@redhat.com>
 
        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 (file)
index 0000000..9cdbcdf
--- /dev/null
@@ -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