Dear all, as requested,

See attached patch 12 of 13

Best Regards,

Jerry
commit 931beb35f95da885cde88a12ced4bef630b6b1c3
Author: Andre Vehreschild <[email protected]>
Date:   Fri Feb 6 15:01:52 2026 +0100

    Fortran: Ensure constant strings are send correctly to caf.
    
    gcc/fortran/ChangeLog:
    
            * trans-intrinsic.cc (conv_caf_send_to_remote): Fix treating constant
            char arrays when used in coarray sends.

diff --git a/gcc/fortran/trans-intrinsic.cc b/gcc/fortran/trans-intrinsic.cc
index a56e541f740..487ad5de4b9 100644
--- a/gcc/fortran/trans-intrinsic.cc
+++ b/gcc/fortran/trans-intrinsic.cc
@@ -1486,7 +1486,8 @@ conv_caf_send_to_remote (gfc_code *code)
   gfc_init_se (&rhs_se, NULL);
   if (rhs_expr->rank == 0)
     {
-      rhs_se.want_pointer = rhs_expr->ts.type == BT_CHARACTER;
+      rhs_se.want_pointer = rhs_expr->ts.type == BT_CHARACTER
+			    && rhs_expr->expr_type != EXPR_CONSTANT;
       gfc_conv_expr (&rhs_se, rhs_expr);
       gfc_add_block_to_block (&block, &rhs_se.pre);
       opt_rhs_desc = null_pointer_node;

Reply via email to