[PR72741] The name in a Fortran OpenACC 'routine' directive refers to the containing...
authorThomas Schwinge <thomas@codesourcery.com>
Thu, 21 Mar 2019 19:54:51 +0000 (20:54 +0100)
committerThomas Schwinge <tschwinge@gcc.gnu.org>
Thu, 21 Mar 2019 19:54:51 +0000 (20:54 +0100)
gcc/fortran/
PR fortran/72741
* openmp.c (gfc_match_oacc_routine): Clarify.
gcc/testsuite/
PR fortran/72741
* gfortran.dg/goacc/routine-module-mod-1.f90: Update.

From-SVN: r269856

gcc/fortran/ChangeLog
gcc/fortran/openmp.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/goacc/routine-module-mod-1.f90

index 2afab3920bda413c51ea83541bfee368b4361e55..111e3a266e9b0d3c62c0161c7edc6d4a0aa1c518 100644 (file)
@@ -1,5 +1,8 @@
 2019-03-21  Thomas Schwinge  <thomas@codesourcery.com>
 
+       PR fortran/72741
+       * openmp.c (gfc_match_oacc_routine): Clarify.
+
        PR fortran/72741
        * module.c (verify_OACC_ROUTINE_LOP_NONE): New function.
        (enum ab_attribute): Add AB_OACC_ROUTINE_LOP_GANG,
index 7a06eb58f5cf5e030b2f9f6792eff62cf27284f7..1b1a0b4108fd8f85f9c58c6a9fa2872467b1e8a3 100644 (file)
@@ -2314,6 +2314,9 @@ gfc_match_oacc_routine (void)
          if (st)
            {
              sym = st->n.sym;
+             /* If the name in a 'routine' directive refers to the containing
+                subroutine or function, then make sure that we'll later handle
+                this accordingly.  */
              if (gfc_current_ns->proc_name != NULL
                  && strcmp (sym->name, gfc_current_ns->proc_name->name) == 0)
                sym = NULL;
index 8afdf3e980e9b93341622e381b0da23bbd23a1f6..0c94f6bcacf8c0af45fc8c2c8ecec53376d55a1d 100644 (file)
@@ -1,5 +1,8 @@
 2019-03-21  Thomas Schwinge  <thomas@codesourcery.com>
 
+       PR fortran/72741
+       * gfortran.dg/goacc/routine-module-mod-1.f90: Update.
+
        PR fortran/72741
        * gfortran.dg/goacc/routine-module-1.f90: New file.
        * gfortran.dg/goacc/routine-module-2.f90: Likewise.
index 3855b8c88596c7ff3a93be7b713b80613d578ad2..23c673fe3bd1b20e8d0926bd18ae53dcdbc7f5bb 100644 (file)
@@ -18,7 +18,7 @@ contains
 
   subroutine s_2
     implicit none
-    !$acc routine seq
+    !$acc routine (s_2) seq
 
     integer :: i
 
@@ -41,7 +41,7 @@ contains
 
   subroutine w_1
     implicit none
-    !$acc routine worker
+    !$acc routine (w_1) worker
 
     integer :: i