]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/fortran/openmp.c
OpenACC/Fortran: permit 'routine' inside PURE
[thirdparty/gcc.git] / gcc / fortran / openmp.c
index b24630827c9e4cca007ba5aa75dca4361f19269a..94522d16e6d6bca85ac70876fa98cddc86eb8559 100644 (file)
@@ -2525,6 +2525,14 @@ gfc_match_oacc_routine (void)
     /* Something has gone wrong, possibly a syntax error.  */
     goto cleanup;
 
+  if (gfc_pure (NULL) && c && (c->gang || c->worker || c->vector))
+    {
+      gfc_error ("!$ACC ROUTINE with GANG, WORKER, or VECTOR clause is not "
+                "permitted in PURE procedure at %C");
+      goto cleanup;
+    }
+
+
   if (n)
     n->clauses = c;
   else if (gfc_current_ns->oacc_routine)