aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/trans-decl.c')
-rw-r--r--gcc/fortran/trans-decl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index ba9cf06d4e4..272ac57dd58 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -887,6 +887,10 @@ gfc_build_qualified_array (tree decl, gfc_symbol * sym)
DECL_CONTEXT (token) = sym->ns->proc_name->backend_decl;
gfc_module_add_decl (cur_module, token);
}
+ else if (sym->attr.host_assoc
+ && TREE_CODE (DECL_CONTEXT (current_function_decl))
+ != TRANSLATION_UNIT_DECL)
+ gfc_add_decl_to_parent_function (token);
else
gfc_add_decl_to_function (token);
}