aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Vehreschild <vehre@gcc.gnu.org>2025-02-19 09:04:47 +0100
committerAndre Vehreschild <vehre@gcc.gnu.org>2025-02-25 10:10:36 +0100
commitcc81363c33a3b5768daf2d8a62ae1a80db12ef96 (patch)
tree38ed0e26b23404d8bc52efa067ba536a7c5065c2
parentcdffc76393488a73671b70481cf8a4b7c289029d (diff)
downloadgcc-cc81363c33a3b5768daf2d8a62ae1a80db12ef96.zip
gcc-cc81363c33a3b5768daf2d8a62ae1a80db12ef96.tar.gz
gcc-cc81363c33a3b5768daf2d8a62ae1a80db12ef96.tar.bz2
Fortran: Use correct size when transferring between images [PR107635]
gcc/fortran/ChangeLog: PR fortran/107635 * trans-intrinsic.cc (conv_caf_sendget): Use the size of data transferred between the two images and not the descritor's size.
-rw-r--r--gcc/fortran/trans-intrinsic.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/fortran/trans-intrinsic.cc b/gcc/fortran/trans-intrinsic.cc
index 2c4c478..80e98dc 100644
--- a/gcc/fortran/trans-intrinsic.cc
+++ b/gcc/fortran/trans-intrinsic.cc
@@ -1658,20 +1658,23 @@ conv_caf_sendget (gfc_code *code)
gfc_init_se (&rhs_se, NULL);
if (rhs_expr->rank == 0)
{
- gfc_conv_expr (&rhs_se, rhs_expr);
- gfc_add_block_to_block (&block, &rhs_se.pre);
opt_rhs_desc = null_pointer_node;
if (rhs_expr->ts.type == BT_CHARACTER)
{
+ gfc_conv_expr (&rhs_se, rhs_expr);
+ gfc_add_block_to_block (&block, &rhs_se.pre);
opt_rhs_charlen = gfc_build_addr_expr (
NULL_TREE, gfc_trans_force_lval (&block, rhs_se.string_length));
rhs_size = build_int_cstu (size_type_node, rhs_expr->ts.kind);
}
else
{
+ gfc_typespec *ts
+ = &sender_fn_expr->symtree->n.sym->formal->next->next->sym->ts;
+
opt_rhs_charlen
= build_zero_cst (build_pointer_type (size_type_node));
- rhs_size = TREE_TYPE (rhs_se.expr)->type_common.size_unit;
+ rhs_size = gfc_typenode_for_spec (ts)->type_common.size_unit;
}
}
else if (!TYPE_LANG_SPECIFIC (TREE_TYPE (rhs_caf_decl))->rank