aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/fortran/trans-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/fortran/trans-common.c')
-rw-r--r--gcc-4.9/gcc/fortran/trans-common.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/fortran/trans-common.c b/gcc-4.9/gcc/fortran/trans-common.c
index 19eaddae2..bb66abc36 100644
--- a/gcc-4.9/gcc/fortran/trans-common.c
+++ b/gcc-4.9/gcc/fortran/trans-common.c
@@ -456,6 +456,11 @@ build_common_decl (gfc_common_head *com, tree union_type, bool is_init)
if (com->threadprivate)
DECL_TLS_MODEL (decl) = decl_default_tls_model (decl);
+ if (com->omp_declare_target)
+ DECL_ATTRIBUTES (decl)
+ = tree_cons (get_identifier ("omp declare target"),
+ NULL_TREE, DECL_ATTRIBUTES (decl));
+
/* Place the back end declaration for this common block in
GLOBAL_BINDING_LEVEL. */
gfc_map_of_all_commons[identifier] = pushdecl_top_level (decl);
@@ -705,6 +710,7 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv)
TREE_ADDRESSABLE (var_decl) = 1;
/* Fake variables are not visible from other translation units. */
TREE_PUBLIC (var_decl) = 0;
+ gfc_finish_decl_attrs (var_decl, &s->sym->attr);
/* To preserve identifier names in COMMON, chain to procedure
scope unless at top level in a module definition. */