Commit 4971dd80 by Andre Vehreschild

expr.c (gfc_find_stat_co): Fixed whitespaces.

gcc/fortran/ChangeLog:

2016-07-22  Andre Vehreschild  <vehre@gcc.gnu.org>

	* expr.c (gfc_find_stat_co): Fixed whitespaces.
	* gfortran.texi: Fixed typos and reversed meaning of caf_get()'s
	src and dst description.
	* trans-decl.c (gfc_build_builtin_function_decls): Fixed style
	and corrected fnspec for caf functions.
	* trans-intrinsic.c (gfc_conv_intrinsic_caf_get): Fixed style.
	(conv_caf_send): Dito.

From-SVN: r238635
parent b588c7f8
2016-07-22 Andre Vehreschild <vehre@gcc.gnu.org>
* expr.c (gfc_find_stat_co): Fixed whitespaces.
* gfortran.texi: Fixed typos and reversed meaning of caf_get()'s
src and dst description.
* trans-decl.c (gfc_build_builtin_function_decls): Fixed style
and corrected fnspec for caf functions.
* trans-intrinsic.c (gfc_conv_intrinsic_caf_get): Fixed style.
(conv_caf_send): Dito.
2016-07-19 Thomas Koenig <tkoenig@gcc.gnu.org> 2016-07-19 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/71902 PR fortran/71902
......
...@@ -4437,9 +4437,9 @@ gfc_find_stat_co(gfc_expr *e) ...@@ -4437,9 +4437,9 @@ gfc_find_stat_co(gfc_expr *e)
if (ref->type == REF_ARRAY && ref->u.ar.codimen > 0) if (ref->type == REF_ARRAY && ref->u.ar.codimen > 0)
return ref->u.ar.stat; return ref->u.ar.stat;
if(e->value.function.actual->expr) if (e->value.function.actual->expr)
for(ref = e->value.function.actual->expr->ref; ref; for (ref = e->value.function.actual->expr->ref; ref;
ref = ref->next) ref = ref->next)
if (ref->type == REF_ARRAY && ref->u.ar.codimen > 0) if (ref->type == REF_ARRAY && ref->u.ar.codimen > 0)
return ref->u.ar.stat; return ref->u.ar.stat;
......
...@@ -3799,7 +3799,7 @@ compared to the base address of the coarray. ...@@ -3799,7 +3799,7 @@ compared to the base address of the coarray.
number. number.
@item @var{dest} @tab intent(in) Array descriptor for the remote image for the @item @var{dest} @tab intent(in) Array descriptor for the remote image for the
bounds and the size. The base_addr shall not be accessed. bounds and the size. The base_addr shall not be accessed.
@item @var{dst_vector} @tab intent(int) If not NULL, it contains the vector @item @var{dst_vector} @tab intent(in) If not NULL, it contains the vector
subscript of the destination array; the values are relative to the dimension subscript of the destination array; the values are relative to the dimension
triplet of the dest argument. triplet of the dest argument.
@item @var{src} @tab intent(in) Array descriptor of the local array to be @item @var{src} @tab intent(in) Array descriptor of the local array to be
...@@ -3839,7 +3839,7 @@ Called to get an array section or whole array from a a remote, ...@@ -3839,7 +3839,7 @@ Called to get an array section or whole array from a a remote,
image identified by the image_index. image identified by the image_index.
@item @emph{Syntax}: @item @emph{Syntax}:
@code{void _gfortran_caf_get_desc (caf_token_t token, size_t offset, @code{void _gfortran_caf_get (caf_token_t token, size_t offset,
int image_index, gfc_descriptor_t *src, caf_vector_t *src_vector, int image_index, gfc_descriptor_t *src, caf_vector_t *src_vector,
gfc_descriptor_t *dest, int src_kind, int dst_kind, bool may_require_tmp)} gfc_descriptor_t *dest, int src_kind, int dst_kind, bool may_require_tmp)}
...@@ -3850,13 +3850,13 @@ gfc_descriptor_t *dest, int src_kind, int dst_kind, bool may_require_tmp)} ...@@ -3850,13 +3850,13 @@ gfc_descriptor_t *dest, int src_kind, int dst_kind, bool may_require_tmp)}
compared to the base address of the coarray. compared to the base address of the coarray.
@item @var{image_index} @tab The ID of the remote image; must be a positive @item @var{image_index} @tab The ID of the remote image; must be a positive
number. number.
@item @var{dest} @tab intent(in) Array descriptor of the local array to be @item @var{dest} @tab intent(out) Array descriptor of the local array to store
transferred to the remote image the data transferred from the remote image
@item @var{src} @tab intent(in) Array descriptor for the remote image for the @item @var{src} @tab intent(in) Array descriptor for the remote image for the
bounds and the size. The base_addr shall not be accessed. bounds and the size. The base_addr shall not be accessed.
@item @var{src_vector} @tab intent(int) If not NULL, it contains the vector @item @var{src_vector} @tab intent(in) If not NULL, it contains the vector
subscript of the destination array; the values are relative to the dimension subscript of the source array; the values are relative to the dimension
triplet of the dest argument. triplet of the src argument.
@item @var{dst_kind} @tab Kind of the destination argument @item @var{dst_kind} @tab Kind of the destination argument
@item @var{src_kind} @tab Kind of the source argument @item @var{src_kind} @tab Kind of the source argument
@item @var{may_require_tmp} @tab The variable is false it is known at compile @item @var{may_require_tmp} @tab The variable is false it is known at compile
......
...@@ -3538,38 +3538,38 @@ gfc_build_builtin_function_decls (void) ...@@ -3538,38 +3538,38 @@ gfc_build_builtin_function_decls (void)
= build_pointer_type (build_pointer_type (pchar_type_node)); = build_pointer_type (build_pointer_type (pchar_type_node));
gfor_fndecl_caf_init = gfc_build_library_function_decl ( gfor_fndecl_caf_init = gfc_build_library_function_decl (
get_identifier (PREFIX("caf_init")), void_type_node, get_identifier (PREFIX("caf_init")), void_type_node,
2, pint_type, pppchar_type); 2, pint_type, pppchar_type);
gfor_fndecl_caf_finalize = gfc_build_library_function_decl ( gfor_fndecl_caf_finalize = gfc_build_library_function_decl (
get_identifier (PREFIX("caf_finalize")), void_type_node, 0); get_identifier (PREFIX("caf_finalize")), void_type_node, 0);
gfor_fndecl_caf_this_image = gfc_build_library_function_decl ( gfor_fndecl_caf_this_image = gfc_build_library_function_decl (
get_identifier (PREFIX("caf_this_image")), integer_type_node, get_identifier (PREFIX("caf_this_image")), integer_type_node,
1, integer_type_node); 1, integer_type_node);
gfor_fndecl_caf_num_images = gfc_build_library_function_decl ( gfor_fndecl_caf_num_images = gfc_build_library_function_decl (
get_identifier (PREFIX("caf_num_images")), integer_type_node, get_identifier (PREFIX("caf_num_images")), integer_type_node,
2, integer_type_node, integer_type_node); 2, integer_type_node, integer_type_node);
gfor_fndecl_caf_register = gfc_build_library_function_decl_with_spec ( gfor_fndecl_caf_register = gfc_build_library_function_decl_with_spec (
get_identifier (PREFIX("caf_register")), "...WWW", pvoid_type_node, 6, get_identifier (PREFIX("caf_register")), "...WWW", pvoid_type_node, 6,
size_type_node, integer_type_node, ppvoid_type_node, pint_type, size_type_node, integer_type_node, ppvoid_type_node, pint_type,
pchar_type_node, integer_type_node); pchar_type_node, integer_type_node);
gfor_fndecl_caf_deregister = gfc_build_library_function_decl_with_spec ( gfor_fndecl_caf_deregister = gfc_build_library_function_decl_with_spec (
get_identifier (PREFIX("caf_deregister")), ".WWW", void_type_node, 4, get_identifier (PREFIX("caf_deregister")), ".WWW", void_type_node, 4,
ppvoid_type_node, pint_type, pchar_type_node, integer_type_node); ppvoid_type_node, pint_type, pchar_type_node, integer_type_node);
gfor_fndecl_caf_get = gfc_build_library_function_decl_with_spec ( gfor_fndecl_caf_get = gfc_build_library_function_decl_with_spec (
get_identifier (PREFIX("caf_get")), ".R.RRRWW", void_type_node, 10, get_identifier (PREFIX("caf_get")), ".R.RRWRRRW", void_type_node, 10,
pvoid_type_node, size_type_node, integer_type_node, pvoid_type_node, pvoid_type_node, size_type_node, integer_type_node, pvoid_type_node,
pvoid_type_node, pvoid_type_node, integer_type_node, integer_type_node, pvoid_type_node, pvoid_type_node, integer_type_node, integer_type_node,
boolean_type_node, pint_type); boolean_type_node, pint_type);
gfor_fndecl_caf_send = gfc_build_library_function_decl_with_spec ( gfor_fndecl_caf_send = gfc_build_library_function_decl_with_spec (
get_identifier (PREFIX("caf_send")), ".R.RRRRW", void_type_node, 10, get_identifier (PREFIX("caf_send")), ".R.RRRRRRW", void_type_node, 10,
pvoid_type_node, size_type_node, integer_type_node, pvoid_type_node, pvoid_type_node, size_type_node, integer_type_node, pvoid_type_node,
pvoid_type_node, pvoid_type_node, integer_type_node, integer_type_node, pvoid_type_node, pvoid_type_node, integer_type_node, integer_type_node,
boolean_type_node, pint_type); boolean_type_node, pint_type);
...@@ -3606,31 +3606,31 @@ gfc_build_builtin_function_decls (void) ...@@ -3606,31 +3606,31 @@ gfc_build_builtin_function_decls (void)
TREE_THIS_VOLATILE (gfor_fndecl_caf_error_stop_str) = 1; TREE_THIS_VOLATILE (gfor_fndecl_caf_error_stop_str) = 1;
gfor_fndecl_caf_stop_numeric = gfc_build_library_function_decl_with_spec ( gfor_fndecl_caf_stop_numeric = gfc_build_library_function_decl_with_spec (
get_identifier (PREFIX("caf_stop_numeric")), ".R.", get_identifier (PREFIX("caf_stop_numeric")), ".R.",
void_type_node, 1, gfc_int4_type_node); void_type_node, 1, gfc_int4_type_node);
/* CAF's STOP doesn't return. */ /* CAF's STOP doesn't return. */
TREE_THIS_VOLATILE (gfor_fndecl_caf_stop_numeric) = 1; TREE_THIS_VOLATILE (gfor_fndecl_caf_stop_numeric) = 1;
gfor_fndecl_caf_stop_str = gfc_build_library_function_decl_with_spec ( gfor_fndecl_caf_stop_str = gfc_build_library_function_decl_with_spec (
get_identifier (PREFIX("caf_stop_str")), ".R.", get_identifier (PREFIX("caf_stop_str")), ".R.",
void_type_node, 2, pchar_type_node, gfc_int4_type_node); void_type_node, 2, pchar_type_node, gfc_int4_type_node);
/* CAF's STOP doesn't return. */ /* CAF's STOP doesn't return. */
TREE_THIS_VOLATILE (gfor_fndecl_caf_stop_str) = 1; TREE_THIS_VOLATILE (gfor_fndecl_caf_stop_str) = 1;
gfor_fndecl_caf_atomic_def = gfc_build_library_function_decl_with_spec ( gfor_fndecl_caf_atomic_def = gfc_build_library_function_decl_with_spec (
get_identifier (PREFIX("caf_atomic_define")), "R..RW", get_identifier (PREFIX("caf_atomic_define")), "R..RW",
void_type_node, 7, pvoid_type_node, size_type_node, integer_type_node, void_type_node, 7, pvoid_type_node, size_type_node, integer_type_node,
pvoid_type_node, pint_type, integer_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 ( gfor_fndecl_caf_atomic_ref = gfc_build_library_function_decl_with_spec (
get_identifier (PREFIX("caf_atomic_ref")), "R..WW", get_identifier (PREFIX("caf_atomic_ref")), "R..WW",
void_type_node, 7, pvoid_type_node, size_type_node, integer_type_node, void_type_node, 7, pvoid_type_node, size_type_node, integer_type_node,
pvoid_type_node, pint_type, integer_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 ( gfor_fndecl_caf_atomic_cas = gfc_build_library_function_decl_with_spec (
get_identifier (PREFIX("caf_atomic_cas")), "R..WRRW", get_identifier (PREFIX("caf_atomic_cas")), "R..WRRW",
void_type_node, 9, pvoid_type_node, size_type_node, integer_type_node, void_type_node, 9, pvoid_type_node, size_type_node, integer_type_node,
pvoid_type_node, pvoid_type_node, pvoid_type_node, pint_type, pvoid_type_node, pvoid_type_node, pvoid_type_node, pint_type,
integer_type_node, integer_type_node); integer_type_node, integer_type_node);
gfor_fndecl_caf_atomic_op = gfc_build_library_function_decl_with_spec ( gfor_fndecl_caf_atomic_op = gfc_build_library_function_decl_with_spec (
...@@ -3682,7 +3682,7 @@ gfc_build_builtin_function_decls (void) ...@@ -3682,7 +3682,7 @@ gfc_build_builtin_function_decls (void)
gfor_fndecl_co_reduce = gfc_build_library_function_decl_with_spec ( gfor_fndecl_co_reduce = gfc_build_library_function_decl_with_spec (
get_identifier (PREFIX("caf_co_reduce")), "W.R.WW", get_identifier (PREFIX("caf_co_reduce")), "W.R.WW",
void_type_node, 8, pvoid_type_node, void_type_node, 8, pvoid_type_node,
build_pointer_type (build_varargs_function_type_list (void_type_node, build_pointer_type (build_varargs_function_type_list (void_type_node,
NULL_TREE)), NULL_TREE)),
integer_type_node, integer_type_node, pint_type, pchar_type_node, integer_type_node, integer_type_node, pint_type, pchar_type_node,
integer_type_node, integer_type_node); integer_type_node, integer_type_node);
......
...@@ -1122,12 +1122,12 @@ gfc_conv_intrinsic_caf_get (gfc_se *se, gfc_expr *expr, tree lhs, tree lhs_kind, ...@@ -1122,12 +1122,12 @@ gfc_conv_intrinsic_caf_get (gfc_se *se, gfc_expr *expr, tree lhs, tree lhs_kind,
dst_var = lhs; dst_var = lhs;
vec = null_pointer_node; vec = null_pointer_node;
tmp_stat = gfc_find_stat_co(expr); tmp_stat = gfc_find_stat_co (expr);
if (tmp_stat) if (tmp_stat)
{ {
gfc_se stat_se; gfc_se stat_se;
gfc_init_se(&stat_se, NULL); gfc_init_se (&stat_se, NULL);
gfc_conv_expr_reference (&stat_se, tmp_stat); gfc_conv_expr_reference (&stat_se, tmp_stat);
stat = stat_se.expr; stat = stat_se.expr;
gfc_add_block_to_block (&se->pre, &stat_se.pre); gfc_add_block_to_block (&se->pre, &stat_se.pre);
...@@ -1225,7 +1225,7 @@ gfc_conv_intrinsic_caf_get (gfc_se *se, gfc_expr *expr, tree lhs, tree lhs_kind, ...@@ -1225,7 +1225,7 @@ gfc_conv_intrinsic_caf_get (gfc_se *se, gfc_expr *expr, tree lhs, tree lhs_kind,
may_require_tmp = boolean_false_node; may_require_tmp = boolean_false_node;
/* It guarantees memory consistency within the same segment */ /* It guarantees memory consistency within the same segment */
tmp = gfc_build_string_const (strlen ("memory")+1, "memory"), tmp = gfc_build_string_const (strlen ("memory") + 1, "memory"),
tmp = build5_loc (input_location, ASM_EXPR, void_type_node, tmp = build5_loc (input_location, ASM_EXPR, void_type_node,
gfc_build_string_const (1, ""), NULL_TREE, NULL_TREE, gfc_build_string_const (1, ""), NULL_TREE, NULL_TREE,
tree_cons (NULL_TREE, tmp, NULL_TREE), NULL_TREE); tree_cons (NULL_TREE, tmp, NULL_TREE), NULL_TREE);
...@@ -1390,7 +1390,7 @@ conv_caf_send (gfc_code *code) { ...@@ -1390,7 +1390,7 @@ conv_caf_send (gfc_code *code) {
rhs_kind = build_int_cst (integer_type_node, rhs_expr->ts.kind); rhs_kind = build_int_cst (integer_type_node, rhs_expr->ts.kind);
tmp_stat = gfc_find_stat_co(lhs_expr); tmp_stat = gfc_find_stat_co (lhs_expr);
if (tmp_stat) if (tmp_stat)
{ {
...@@ -1414,8 +1414,8 @@ conv_caf_send (gfc_code *code) { ...@@ -1414,8 +1414,8 @@ conv_caf_send (gfc_code *code) {
tree rhs_token, rhs_offset, rhs_image_index; tree rhs_token, rhs_offset, rhs_image_index;
/* It guarantees memory consistency within the same segment */ /* It guarantees memory consistency within the same segment */
tmp = gfc_build_string_const (strlen ("memory")+1, "memory"), tmp = gfc_build_string_const (strlen ("memory") + 1, "memory"),
tmp = build5_loc (input_location, ASM_EXPR, void_type_node, tmp = build5_loc (input_location, ASM_EXPR, void_type_node,
gfc_build_string_const (1, ""), NULL_TREE, NULL_TREE, gfc_build_string_const (1, ""), NULL_TREE, NULL_TREE,
tree_cons (NULL_TREE, tmp, NULL_TREE), NULL_TREE); tree_cons (NULL_TREE, tmp, NULL_TREE), NULL_TREE);
ASM_VOLATILE_P (tmp) = 1; ASM_VOLATILE_P (tmp) = 1;
...@@ -1438,7 +1438,7 @@ conv_caf_send (gfc_code *code) { ...@@ -1438,7 +1438,7 @@ conv_caf_send (gfc_code *code) {
gfc_add_block_to_block (&block, &rhs_se.post); gfc_add_block_to_block (&block, &rhs_se.post);
/* It guarantees memory consistency within the same segment */ /* It guarantees memory consistency within the same segment */
tmp = gfc_build_string_const (strlen ("memory")+1, "memory"), tmp = gfc_build_string_const (strlen ("memory") + 1, "memory"),
tmp = build5_loc (input_location, ASM_EXPR, void_type_node, tmp = build5_loc (input_location, ASM_EXPR, void_type_node,
gfc_build_string_const (1, ""), NULL_TREE, NULL_TREE, gfc_build_string_const (1, ""), NULL_TREE, NULL_TREE,
tree_cons (NULL_TREE, tmp, NULL_TREE), NULL_TREE); tree_cons (NULL_TREE, tmp, NULL_TREE), NULL_TREE);
......
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