Add entrypoint attribute for the use of nvptx.
authorBernd Schmidt <bernds@codesourcery.com>
Tue, 24 Feb 2015 21:37:42 +0000 (21:37 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Tue, 24 Feb 2015 21:37:42 +0000 (21:37 +0000)
* omp-low.c (create_omp_child_function): Tag entrypoint
functions with a special attribute.

From-SVN: r220950

gcc/ChangeLog
gcc/omp-low.c

index f71deca5a975b307a3ae6e48055273c1d9b90d0e..d69d7b793c418f14f6a3797d6c05f2ebd375036a 100644 (file)
@@ -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
index 182836b3a66c2392e1c414eccd1ddd427c3686ec..75d6707f1987f3a93f53af7ce1ffa75924ff3746 100644 (file)
@@ -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;