https://gcc.gnu.org/g:dc8af1a7b28e695b8145cd2e55494b973f76851c

commit dc8af1a7b28e695b8145cd2e55494b973f76851c
Author: Mikael Morin <[email protected]>
Date:   Fri Oct 17 14:52:38 2025 +0200

    Correction régression nested_array_constructor_3.f90

Diff:
---
 gcc/fortran/trans-descriptor.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/fortran/trans-descriptor.cc b/gcc/fortran/trans-descriptor.cc
index 5ab2b98cb059..6ef9fa8145a2 100644
--- a/gcc/fortran/trans-descriptor.cc
+++ b/gcc/fortran/trans-descriptor.cc
@@ -2328,12 +2328,11 @@ gfc_set_descriptor (stmtblock_t *block, tree dest, tree 
src, gfc_expr *src_expr,
     }
   else if (src_expr->rank != -1
           && src_expr->ts.type == BT_CHARACTER
-          && src_expr->ts.deferred
           && !element_size_known (dest))
     {
       bool bytes_strides = GFC_BYTES_STRIDES_ARRAY_TYPE_P (TREE_TYPE (dest));
       dtype = get_dtype_rank_type_size (src_expr->rank, BT_CHARACTER,
-                                       bytes_strides, NULL_TREE);
+                                       bytes_strides, ss->info->string_length);
     }
   else
     dtype = gfc_get_dtype (TREE_TYPE (dest));
@@ -2343,6 +2342,7 @@ gfc_set_descriptor (stmtblock_t *block, tree dest, tree 
src, gfc_expr *src_expr,
     gfc_conv_descriptor_elem_len_set (block, dest, span);
   else if (src_expr->rank != -1
           && src_expr->ts.type == BT_CHARACTER
+          && ss->info->string_length == NULL_TREE
           && !element_size_known (dest))
     {
       tree src_desc = src;

Reply via email to