]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[PR90921] Fortran OpenACC 'declare' directive's module handling causes duplicate...
authortschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Jun 2019 22:15:53 +0000 (22:15 +0000)
committertschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Jun 2019 22:15:53 +0000 (22:15 +0000)
gcc/fortran/
PR fortran/90921
* trans-decl.c (finish_oacc_declare): Reset module_oacc_clauses
before scanning each namespace.
gcc/testsuite/
PR fortran/90921
* gfortran.dg/goacc/declare-3.f95: Update.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@272454 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/trans-decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/goacc/declare-3.f95

index 6fd97b61ce0568e709d70bdd73f0b7179230f0db..32d961ade9601a83fb6517019dd510bae3c4aade 100644 (file)
@@ -1,3 +1,9 @@
+2019-06-18  Julian Brown  <julian@codesourcery.com>
+
+       PR fortran/90921
+       * trans-decl.c (finish_oacc_declare): Reset module_oacc_clauses
+       before scanning each namespace.
+
 2019-06-18  Thomas Schwinge  <thomas@codesourcery.com>
 
        PR fortran/85221
index f504c279c31bd05822289770d2a5fa2d529c891b..64ce4bba23d9afe0763d172bc50fe856c9d11121 100644 (file)
@@ -6491,6 +6491,7 @@ finish_oacc_declare (gfc_namespace *ns, gfc_symbol *sym, bool block)
   gfc_omp_clauses *omp_clauses = NULL;
   gfc_omp_namelist *n, *p;
 
+  module_oacc_clauses = NULL;
   gfc_traverse_ns (ns, find_module_oacc_declare_clauses);
 
   if (module_oacc_clauses && sym->attr.flavor == FL_PROGRAM)
@@ -6502,7 +6503,6 @@ finish_oacc_declare (gfc_namespace *ns, gfc_symbol *sym, bool block)
       new_oc->clauses = module_oacc_clauses;
 
       ns->oacc_declare = new_oc;
-      module_oacc_clauses = NULL;
     }
 
   if (!ns->oacc_declare)
index 552ccc6fbd68cfd11f6b93a564d188fe80504fa4..6ff197c8e4dc60f1bf4234ad68d2dfb30756b8a4 100644 (file)
@@ -1,5 +1,8 @@
 2019-06-18  Thomas Schwinge  <thomas@codesourcery.com>
 
+       PR fortran/90921
+       * gfortran.dg/goacc/declare-3.f95: Update.
+
        PR fortran/85221
        * gfortran.dg/goacc/declare-3.f95: New file.
 
index ec5d4c5a062a7b1d3f2b737aa8e91797527d8dc4..80d9903a9dc6cff57528e5d01a980ab25365b19b 100644 (file)
@@ -1,5 +1,7 @@
 ! Test valid usage of the OpenACC 'declare' directive.
 
+! { dg-additional-options "-fdump-tree-original" }
+
 module mod_a
   implicit none
   integer :: a
@@ -44,4 +46,8 @@ program test
   use mod_c
   use mod_d
   use mod_e
+
+  ! { dg-final { scan-tree-dump {(?n)#pragma acc data map\(force_alloc:d\) map\(force_deviceptr:c\) map\(force_to:b\) map\(force_alloc:a\)$} original } }
 end program test
+
+! { dg-final { scan-tree-dump-times {#pragma acc data} 1 original } }