aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2019-06-19 00:15:43 +0200
committerThomas Schwinge <tschwinge@gcc.gnu.org>2019-06-19 00:15:43 +0200
commitca8ecd919453664b1312e6c7d236e404731d8bb0 (patch)
tree1e4e88568ff968cd0e7942ff3f2d651473a1250c /gcc/fortran
parent02fd3a0ecc6931fcb0afc1b74ebc38d178c2d84f (diff)
downloadgcc-ca8ecd919453664b1312e6c7d236e404731d8bb0.zip
gcc-ca8ecd919453664b1312e6c7d236e404731d8bb0.tar.gz
gcc-ca8ecd919453664b1312e6c7d236e404731d8bb0.tar.bz2
[PR85221] Set 'omp declare target', 'omp declare target link' attributes for Fortran OpenACC 'declare'd variables
gcc/fortran/ PR fortran/85221 * trans-decl.c (add_attributes_to_decl): Handle OpenACC 'declare' directive. gcc/testsuite/ PR fortran/85221 * gfortran.dg/goacc/declare-3.f95: New file. From-SVN: r272453
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/trans-decl.c9
2 files changed, 13 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index d30fa2e5..6fd97b6 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2019-06-18 Thomas Schwinge <thomas@codesourcery.com>
+
+ PR fortran/85221
+ * trans-decl.c (add_attributes_to_decl): Handle OpenACC 'declare'
+ directive.
+
2019-06-16 Thomas Koenig <tkoenig@gcc.gnu.org>
* dump_parse_tree (debug): Add verison for formal arglist.
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index b8e0727..f504c27 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -1432,10 +1432,15 @@ add_attributes_to_decl (symbol_attribute sym_attr, tree list)
list = oacc_replace_fn_attrib_attr (list, dims);
}
- if (sym_attr.omp_declare_target_link)
+ if (sym_attr.omp_declare_target_link
+ || sym_attr.oacc_declare_link)
list = tree_cons (get_identifier ("omp declare target link"),
NULL_TREE, list);
- else if (sym_attr.omp_declare_target)
+ else if (sym_attr.omp_declare_target
+ || sym_attr.oacc_declare_create
+ || sym_attr.oacc_declare_copyin
+ || sym_attr.oacc_declare_deviceptr
+ || sym_attr.oacc_declare_device_resident)
list = tree_cons (get_identifier ("omp declare target"),
clauses, list);