aboutsummaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2020-12-23 11:40:00 +0100
committerThomas Koenig <tkoenig@gcc.gnu.org>2020-12-23 11:40:00 +0100
commitfe0069ed4d6e61dfcd8e66e227690635ba317d1a (patch)
tree114a40b8f5a7ba784c066d71b20c563fe1900c90 /libgfortran
parent1a50de8778750f019e61a97ee6d3e8226c41a7f1 (diff)
Add offset to allocatable shared coarrays.
This adds the calculation of the offset for allocatable coarrays, which was missing before, and fixes the resulting fallout for ALLOCATED. Additionally, it prepares the way for STAT and ERRMSG for ALLOCATE of coarrays, but that still needs changes to gfc_trans_allocate. gcc/fortran/ChangeLog: * trans-array.c (gfc_conv_array_ref): If se->address_only is set, throw away all the offset calculation. (gfc_allocate_shared_coarray): Add arguments stat, errmsg and errlen to call to allocate. Calculate offset for allocatable coarrays. (gfc_array_allocate): Adjust call to gfc_allocate_shared_coarray. * trans-array.h (gfc_allocate_shared_coarray): Change prototype of cas_coarray_alloc. * trans-decl.c (gfc_build_builtin_function_decls): Adjust cas_coarray_alloc to changed prototypes. (gfc_trans_shared_coarray): Adjust call to gfc_allocate_shared_coarray. * trans-intrinsic.c (gfc_conv_allocated): Set address_only on se. * trans.h: Add flag address_only to gfc_se. libgfortran/ChangeLog: * caf_shared/wrapper.c (cas_coarray_alloc): Add status, error and errmsg arguments and their checking.
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/caf_shared/wrapper.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libgfortran/caf_shared/wrapper.c b/libgfortran/caf_shared/wrapper.c
index 471619441c0..a3d88660f01 100644
--- a/libgfortran/caf_shared/wrapper.c
+++ b/libgfortran/caf_shared/wrapper.c
@@ -44,7 +44,8 @@ enum gfc_coarray_allocation_type
GFC_NCA_EVENT_COARRAY,
};
-void cas_coarray_alloc (gfc_array_void *, int, int, int);
+void cas_coarray_alloc (gfc_array_void *, size_t, int, int, int *,
+ char *, size_t);
export_proto (cas_coarray_alloc);
void cas_coarray_free (gfc_array_void *, int);
@@ -85,8 +86,8 @@ void cas_collsub_broadcast_scalar (void *restrict, size_t, int, int *, char *,
export_proto (cas_collsub_broadcast_scalar);
void
-cas_coarray_alloc (gfc_array_void *desc, int elem_size, int corank,
- int alloc_type)
+cas_coarray_alloc (gfc_array_void *desc, size_t elem_size, int corank,
+ int alloc_type, int *status, char *errmsg, size_t errmsg_len)
{
int i, last_rank_index;
int num_coarray_elems, num_elems; /* Excludes the last dimension, because it
@@ -98,6 +99,7 @@ cas_coarray_alloc (gfc_array_void *desc, int elem_size, int corank,
ensure_initialization (); /* This function might be the first one to be
called, if it is called in a constructor. */
+ STAT_ERRMSG_ENTRY_CHECK (status, errmsg, errmsg_len);
if (alloc_type == GFC_NCA_LOCK_COARRAY)
elem_size = sizeof (pthread_mutex_t);
else if (alloc_type == GFC_NCA_EVENT_COARRAY)