aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/omp-offload.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/omp-offload.c b/gcc/omp-offload.c
index a89275b..7fb3a72 100644
--- a/gcc/omp-offload.c
+++ b/gcc/omp-offload.c
@@ -327,11 +327,18 @@ omp_discover_implicit_declare_target (void)
FOR_EACH_DEFINED_FUNCTION (node)
if (DECL_SAVED_TREE (node->decl))
{
+ struct cgraph_node *cgn;
if (omp_declare_target_fn_p (node->decl))
worklist.safe_push (node->decl);
else if (DECL_STRUCT_FUNCTION (node->decl)
&& DECL_STRUCT_FUNCTION (node->decl)->has_omp_target)
worklist.safe_push (node->decl);
+ for (cgn = node->nested; cgn; cgn = cgn->next_nested)
+ if (omp_declare_target_fn_p (cgn->decl))
+ worklist.safe_push (cgn->decl);
+ else if (DECL_STRUCT_FUNCTION (cgn->decl)
+ && DECL_STRUCT_FUNCTION (cgn->decl)->has_omp_target)
+ worklist.safe_push (cgn->decl);
}
FOR_EACH_STATIC_INITIALIZER (vnode)
if (omp_declare_target_var_p (vnode->decl))