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

commit a74cfe84f0c19e9b49879adf4cc555b6caff0c6b
Author: Mikael Morin <[email protected]>
Date:   Mon Nov 9 22:21:53 2026 +0100

    Correction pdt_31

Diff:
---
 gcc/fortran/trans-array.cc | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc
index d1045ccfb19a..9dc95a5f7248 100644
--- a/gcc/fortran/trans-array.cc
+++ b/gcc/fortran/trans-array.cc
@@ -11271,6 +11271,7 @@ structure_alloc_comps (gfc_symbol * der_type, tree 
decl, tree dest,
                tmp = strlen;
              else
                tmp = TYPE_SIZE_UNIT (gfc_get_element_type (ctype));
+             tree elem_len = tmp;
              tmp = fold_convert (gfc_array_index_type, tmp);
              size = fold_build2_loc (input_location, MULT_EXPR,
                                      gfc_array_index_type, size, tmp);
@@ -11279,12 +11280,8 @@ structure_alloc_comps (gfc_symbol * der_type, tree 
decl, tree dest,
              gfc_conv_descriptor_data_set (&fnblock, comp, tmp);
              gfc_conv_descriptor_dtype_set (&fnblock, comp,
                                             gfc_get_dtype (ctype));
-             if (strlen != NULL_TREE)
-               {
-                 tmp = gfc_conv_descriptor_elem_len_get (comp);
-                 gfc_add_modify (&fnblock, tmp, fold_convert (TREE_TYPE (tmp), 
strlen));
-                 gfc_conv_descriptor_span_set (&fnblock, comp, strlen);
-               }
+             gfc_conv_descriptor_elem_len_set (&fnblock, comp, elem_len);
+             gfc_conv_descriptor_span_set (&fnblock, comp, elem_len);
 
              if (c->initializer && c->initializer->rank)
                {

Reply via email to