From d7823208f9f8f1dc5f1b57431037a1ec53c7c57a Mon Sep 17 00:00:00 2001 From: Bernd Schmidt Date: Tue, 24 Feb 2015 21:37:42 +0000 Subject: [PATCH] Add entrypoint attribute for the use of nvptx. * omp-low.c (create_omp_child_function): Tag entrypoint functions with a special attribute. From-SVN: r220950 --- gcc/ChangeLog | 5 +++++ gcc/omp-low.c | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f71deca..d69d7b7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-02-24 Bernd Schmidt + + * omp-low.c (create_omp_child_function): Tag entrypoint + functions with a special attribute. + 2015-02-24 Michael Haubenwallner PR target/65058 diff --git a/gcc/omp-low.c b/gcc/omp-low.c index 182836b..75d6707 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -2176,6 +2176,13 @@ create_omp_child_function (omp_context *ctx, bool task_copy) } } + if (cgraph_node::get_create (decl)->offloadable + && !lookup_attribute ("omp declare target", + DECL_ATTRIBUTES (current_function_decl))) + DECL_ATTRIBUTES (decl) + = tree_cons (get_identifier ("omp target entrypoint"), + NULL_TREE, DECL_ATTRIBUTES (decl)); + t = build_decl (DECL_SOURCE_LOCATION (decl), RESULT_DECL, NULL_TREE, void_type_node); DECL_ARTIFICIAL (t) = 1; -- 2.7.4