diff options
author | Bernd Schmidt <bernds@codesourcery.com> | 2015-02-24 21:37:42 +0000 |
---|---|---|
committer | Bernd Schmidt <bernds@gcc.gnu.org> | 2015-02-24 21:37:42 +0000 |
commit | d7823208f9f8f1dc5f1b57431037a1ec53c7c57a (patch) | |
tree | a197574b6eb4945f34dce15b13e8a9bf4c422708 /gcc | |
parent | f8571677c0ea8e32f1dafd0d6020eb477ed92e8e (diff) | |
download | gcc-d7823208f9f8f1dc5f1b57431037a1ec53c7c57a.zip gcc-d7823208f9f8f1dc5f1b57431037a1ec53c7c57a.tar.gz gcc-d7823208f9f8f1dc5f1b57431037a1ec53c7c57a.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/omp-low.c | 7 |
2 files changed, 12 insertions, 0 deletions
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 <bernds@codesourcery.com> + + * omp-low.c (create_omp_child_function): Tag entrypoint + functions with a special attribute. + 2015-02-24 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com> 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; |