]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
OpenMP: Minor '!$omp allocators' cleanup
authorTobias Burnus <tobias@codesourcery.com>
Mon, 11 Dec 2023 14:08:07 +0000 (15:08 +0100)
committerTobias Burnus <tobias@codesourcery.com>
Mon, 11 Dec 2023 14:08:07 +0000 (15:08 +0100)
gcc/fortran/ChangeLog:

* trans-openmp.cc (gfc_omp_call_add_alloc,
gfc_omp_call_is_alloc): Set 'fn spec'.

libgomp/ChangeLog:

* libgomp_g.h (GOMP_add_alloc, GOMP_is_alloc): Add.

gcc/fortran/trans-openmp.cc
libgomp/libgomp_g.h

index 9e166c94f8e6a801631f1f2035f15b0e91e5a01a..95184920cf7063919b461956eb48cf15f0d8d853 100644 (file)
@@ -8361,8 +8361,10 @@ gfc_omp_call_add_alloc (tree ptr)
   if (fn == NULL_TREE)
     {
       fn = build_function_type_list (void_type_node, ptr_type_node, NULL_TREE);
+      tree att = build_tree_list (NULL_TREE, build_string (4, ". R "));
+      att = tree_cons (get_identifier ("fn spec"), att, TYPE_ATTRIBUTES (fn));
+      fn = build_type_attribute_variant (fn, att);
       fn = build_fn_decl ("GOMP_add_alloc", fn);
-/* FIXME: attributes.  */
     }
   return build_call_expr_loc (input_location, fn, 1, ptr);
 }
@@ -8380,7 +8382,9 @@ gfc_omp_call_is_alloc (tree ptr)
       fn = build_function_type_list (boolean_type_node, ptr_type_node,
                                     NULL_TREE);
       fn = build_fn_decl ("GOMP_is_alloc", fn);
-/* FIXME: attributes.  */
+      tree att = build_tree_list (NULL_TREE, build_string (4, ". R "));
+      att = tree_cons (get_identifier ("fn spec"), att, TYPE_ATTRIBUTES (fn));
+      fn = build_type_attribute_variant (fn, att);
     }
   return build_call_expr_loc (input_location, fn, 1, ptr);
 }
index 95046312ae9bd1cda2ad2350c2ee816d1f3b7392..ec619f255f2aa012eac318827fbe86bf2fb80879 100644 (file)
@@ -366,6 +366,9 @@ extern void GOMP_teams_reg (void (*) (void *), void *, unsigned, unsigned,
 
 /* allocator.c */
 
+extern void GOMP_add_alloc (void *);
+extern bool GOMP_is_alloc (void *);
+
 extern void *GOMP_alloc (size_t, size_t, uintptr_t);
 extern void GOMP_free (void *, uintptr_t);