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

commit b929e2690a5da9d847b7b5e99ea334489be190bc
Author: Mikael Morin <[email protected]>
Date:   Thu Oct 16 15:27:15 2025 +0200

    Correction régression deferred_character_37.f90

Diff:
---
 gcc/fortran/trans-descriptor.cc | 1 +
 gcc/fortran/trans-expr.cc       | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/fortran/trans-descriptor.cc b/gcc/fortran/trans-descriptor.cc
index 7823f323a177..24a38d26a711 100644
--- a/gcc/fortran/trans-descriptor.cc
+++ b/gcc/fortran/trans-descriptor.cc
@@ -3101,6 +3101,7 @@ gfc_set_descriptor_for_assign_realloc (stmtblock_t 
*block, gfc_loopinfo *loop,
       tree tmp = gfc_get_dtype_rank_type (expr1->rank, type,
                                          bytes_counted_strides);
       gfc_conv_descriptor_dtype_set (block, desc, tmp);
+      gfc_conv_descriptor_elem_len_set (block, desc, elemsize2);
     }
   else if (expr1->ts.type == BT_CLASS)
     {
diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc
index 08176b84f2c7..ce622da9c295 100644
--- a/gcc/fortran/trans-expr.cc
+++ b/gcc/fortran/trans-expr.cc
@@ -57,7 +57,8 @@ gfc_get_character_len (tree type)
              && TYPE_STRING_FLAG (type));
 
   len = TYPE_MAX_VALUE (TYPE_DOMAIN (type));
-  len = (len) ? (len) : (integer_zero_node);
+  if (!len)
+    return NULL_TREE;
   return fold_convert (gfc_charlen_type_node, len);
 }

Reply via email to