aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-decl.c
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2014-07-12 19:02:57 +0000
committerTobias Burnus <burnus@net-b.de>2014-07-12 19:02:57 +0000
commit2e5e0b9185e658a8ac05ff06217bd6efb1685145 (patch)
tree9c63676c636ff51b2efc0a019d14caccdf82245e /gcc/fortran/trans-decl.c
parent00d2cfe908043a5630c11fed58ce2fcdf65b5184 (diff)
2014-07-12 Tobias Burnus <burnus@net-b.de>
gcc/fortran/ * libgfortran.h (libcaf_atomic_codes): Add. * trans-decl.c (gfor_fndecl_caf_atomic_def, gfor_fndecl_caf_atomic_ref, gfor_fndecl_caf_atomic_cas, gfor_fndecl_caf_atomic_op): New variables. (gfc_build_builtin_function_decls): Initialize them. * trans.h (gfor_fndecl_caf_atomic_def, gfor_fndecl_caf_atomic_ref, gfor_fndecl_caf_atomic_cas, gfor_fndecl_caf_atomic_op): New variables. * trans-intrinsic.c (conv_intrinsic_atomic_op, conv_intrinsic_atomic_ref, conv_intrinsic_atomic_cas): Add library calls with -fcoarray=lib. libgfortran/ * caf/libcaf.h (_gfortran_caf_atomic_define, _gfortran_caf_atomic_ref, _gfortran_caf_atomic_op, _gfortran_caf_atomic_cas): New prototypes. * caf/single.c (_gfortran_caf_atomic_define, _gfortran_caf_atomic_ref, _gfortran_caf_atomic_op, _gfortran_caf_atomic_cas): New functions. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@212484 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/trans-decl.c')
-rw-r--r--gcc/fortran/trans-decl.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 00ac010878a..4db10becfd4 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -141,6 +141,10 @@ tree gfor_fndecl_caf_sync_all;
tree gfor_fndecl_caf_sync_images;
tree gfor_fndecl_caf_error_stop;
tree gfor_fndecl_caf_error_stop_str;
+tree gfor_fndecl_caf_atomic_def;
+tree gfor_fndecl_caf_atomic_ref;
+tree gfor_fndecl_caf_atomic_cas;
+tree gfor_fndecl_caf_atomic_op;
tree gfor_fndecl_co_max;
tree gfor_fndecl_co_min;
tree gfor_fndecl_co_sum;
@@ -3391,6 +3395,28 @@ gfc_build_builtin_function_decls (void)
/* CAF's ERROR STOP doesn't return. */
TREE_THIS_VOLATILE (gfor_fndecl_caf_error_stop_str) = 1;
+ gfor_fndecl_caf_atomic_def = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("caf_atomic_define")), "R..RW",
+ void_type_node, 7, pvoid_type_node, size_type_node, integer_type_node,
+ pvoid_type_node, pint_type, integer_type_node, integer_type_node);
+
+ gfor_fndecl_caf_atomic_ref = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("caf_atomic_ref")), "R..WW",
+ void_type_node, 7, pvoid_type_node, size_type_node, integer_type_node,
+ pvoid_type_node, pint_type, integer_type_node, integer_type_node);
+
+ gfor_fndecl_caf_atomic_cas = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("caf_atomic_cas")), "R..WRRW",
+ void_type_node, 9, pvoid_type_node, size_type_node, integer_type_node,
+ pvoid_type_node, pvoid_type_node, pvoid_type_node, pint_type,
+ integer_type_node, integer_type_node);
+
+ gfor_fndecl_caf_atomic_op = gfc_build_library_function_decl_with_spec (
+ get_identifier (PREFIX("caf_atomic_op")), ".R..RWW",
+ void_type_node, 9, integer_type_node, pvoid_type_node, size_type_node,
+ integer_type_node, pvoid_type_node, pvoid_type_node, pint_type,
+ integer_type_node, integer_type_node);
+
gfor_fndecl_co_max = gfc_build_library_function_decl_with_spec (
get_identifier (PREFIX("caf_co_max")), "W.WW",
void_type_node, 6, pvoid_type_node, integer_type_node,