Commit 8701b671 by Julian Brown Committed by Thomas Schwinge

[PR90921] Fortran OpenACC 'declare' directive's module handling causes duplicate data clauses

	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.

From-SVN: r272454
parent ca8ecd91
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
......
......@@ -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)
......
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.
......
! 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 } }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment