Hi Harald, I have added some comment(s). Can you take another look?
Regtested ok on x86_64-pc-linux-gnu / F41. Ok for mainline? Regards, Andre On Sat, 22 Feb 2025 17:36:55 +0100 Andre Vehreschild <ve...@gmx.de> wrote: > Hi Harald, > > thanks for the review. Silently I'd hoped that there is some macro to get > the i-th argument, that I just haven't found and someone could point me to. > I will add a comment, when ko one comes up with the macro by Monday. > > Thanks, > Andre > Andre Vehreschild * ve...@gmx.de > Am 22. Februar 2025 15:29:20 schrieb Harald Anlauf <anl...@gmx.de>: > > > Hi Andre, > > > > Am 21.02.25 um 14:35 schrieb Andre Vehreschild: > >> Hi all, > >> > >> during testing and compiling some larger coarray codes, I found a few > >> deficiencies. One was with handling class types when splitting the coarray > >> expression and the other was that the backend_decl of a formal argument in > >> a function's symbol was not the same as the one the function was compiled > >> to. So looking at the function-decl's tree n-th formal argument is the way > >> to go there. > >> > >> Regtests ok on x86_64-pc-linux-gnu / F41. Ok for mainline? > > > > I am amazed that you do not get lost handling 9-fold nested > > macros! This is OK, as this touches your CAF code. > > > > Otherwise, I'd recommend to add an explaining comment in the > > code or code such that mere mortals have a better chance to > > follow... > > > > Thanks, > > Harald > > > >> Regards, > >> Andre > >> -- > >> Andre Vehreschild * Email: vehre ad gmx dot de > -- Andre Vehreschild * Email: vehre ad gmx dot de
From cecfd1aeb37d65b2880dcbdd55afacb2dde63de0 Mon Sep 17 00:00:00 2001 From: Andre Vehreschild <ve...@gcc.gnu.org> Date: Wed, 19 Feb 2025 09:04:47 +0100 Subject: [PATCH 1/2] 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. --- gcc/fortran/trans-intrinsic.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gcc/fortran/trans-intrinsic.cc b/gcc/fortran/trans-intrinsic.cc index 2c4c47816c8..80e98dc3c20 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 -- 2.48.1