Commit 61fad608 by Andre Vehreschild

gfortran.texi: Fix typos in documentation of caf_register ().

gcc/fortran/ChangeLog:

2018-02-11  Andre Vehreschild  <vehre@gcc.gnu.org>

	* gfortran.texi: Fix typos in documentation of caf_register ().
	* trans-array.c (structure_alloc_comps): Only register a component of
	a derived typed corray, not of an ultimate component coarray.

From-SVN: r257567
parent 5f0367d0
2018-02-11 Andre Vehreschild <vehre@gcc.gnu.org>
* gfortran.texi: Fix typos in documentation of caf_register ().
* trans-array.c (structure_alloc_comps): Only register a component of
a derived typed corray, not of an ultimate component coarray.
2018-02-11 Steven G. Kargl <kargl@gcc.gnu.org> 2018-02-11 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/54223 PR fortran/54223
......
...@@ -4453,8 +4453,8 @@ is not used then. On the contrary when ...@@ -4453,8 +4453,8 @@ is not used then. On the contrary when
@code{CAF_REGTYPE_COARRAY_ALLOC_ALLOCATE_ONLY} is specified, then the @code{CAF_REGTYPE_COARRAY_ALLOC_ALLOCATE_ONLY} is specified, then the
@var{token} needs to be registered by a previous call with regtype @var{token} needs to be registered by a previous call with regtype
@code{CAF_REGTYPE_COARRAY_ALLOC_REGISTER_ONLY} and either the memory specified @code{CAF_REGTYPE_COARRAY_ALLOC_REGISTER_ONLY} and either the memory specified
in the @var{desc}'s data-ptr is registered or allocate when the data-ptr is in the @var{DESC}'s data-ptr is registered or allocate when the data-ptr is
NULL. @code{NULL}.
@item @emph{Syntax}: @item @emph{Syntax}:
@code{void caf_register (size_t size, caf_register_t type, caf_token_t *token, @code{void caf_register (size_t size, caf_register_t type, caf_token_t *token,
...@@ -4468,24 +4468,24 @@ allocated; for lock types and event types, the number of elements. ...@@ -4468,24 +4468,24 @@ allocated; for lock types and event types, the number of elements.
@item @var{token} @tab intent(out) An opaque pointer identifying the coarray. @item @var{token} @tab intent(out) An opaque pointer identifying the coarray.
@item @var{desc} @tab intent(inout) The (pseudo) array descriptor. @item @var{desc} @tab intent(inout) The (pseudo) array descriptor.
@item @var{stat} @tab intent(out) For allocatable coarrays, stores the STAT=; @item @var{stat} @tab intent(out) For allocatable coarrays, stores the STAT=;
may be NULL may be @code{NULL}
@item @var{errmsg} @tab intent(out) When an error occurs, this will be set to @item @var{errmsg} @tab intent(out) When an error occurs, this will be set to
an error message; may be NULL an error message; may be @code{NULL}
@item @var{errmsg_len} @tab the buffer size of errmsg. @item @var{errmsg_len} @tab the buffer size of errmsg.
@end multitable @end multitable
@item @emph{NOTES} @item @emph{NOTES}
Nonalloatable coarrays have to be registered prior use from remote images. Nonallocatable coarrays have to be registered prior use from remote images.
In order to guarantee this, they have to be registered before the main In order to guarantee this, they have to be registered before the main
program. This can be achieved by creating constructor functions. That is what program. This can be achieved by creating constructor functions. That is what
GCC does such that also nonallocatable coarrays the memory is allocated and no GCC does such that also for nonallocatable coarrays the memory is allocated and
static memory is used. The token permits to identify the coarray; to the no static memory is used. The token permits to identify the coarray; to the
processor, the token is a nonaliasing pointer. The library can, for instance, processor, the token is a nonaliasing pointer. The library can, for instance,
store the base address of the coarray in the token, some handle or a more store the base address of the coarray in the token, some handle or a more
complicated struct. The library may also store the array descriptor complicated struct. The library may also store the array descriptor
@var{DESC} when its rank is non-zero. @var{DESC} when its rank is non-zero.
For lock types, the value shall only used for checking the allocation For lock types, the value shall only be used for checking the allocation
status. Note that for critical blocks, the locking is only required on one status. Note that for critical blocks, the locking is only required on one
image; in the locking statement, the processor shall always pass an image; in the locking statement, the processor shall always pass an
image index of one for critical-block lock variables image index of one for critical-block lock variables
......
...@@ -8747,15 +8747,17 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl, ...@@ -8747,15 +8747,17 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl,
cmp_has_alloc_comps = false; cmp_has_alloc_comps = false;
} }
if (flag_coarray == GFC_FCOARRAY_LIB if (flag_coarray == GFC_FCOARRAY_LIB && caf_in_coarray (caf_mode))
&& (caf_in_coarray (caf_mode) || c->attr.codimension))
{ {
/* Register the component with the coarray library. */ /* Register a component of a derived type coarray with the
coarray library. Do not register ultimate component
coarrays here. They are treated like regular coarrays and
are either allocated on all images or on none. */
tree token; tree token;
comp = fold_build3_loc (input_location, COMPONENT_REF, ctype, comp = fold_build3_loc (input_location, COMPONENT_REF, ctype,
decl, cdecl, NULL_TREE); decl, cdecl, NULL_TREE);
if (c->attr.dimension || c->attr.codimension) if (c->attr.dimension)
{ {
/* Set the dtype, because caf_register needs it. */ /* Set the dtype, because caf_register needs it. */
gfc_add_modify (&fnblock, gfc_conv_descriptor_dtype (comp), gfc_add_modify (&fnblock, gfc_conv_descriptor_dtype (comp),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment