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

commit eaecebe14dcc080a5856ad0b2bf22b50d2fb9a1a
Author: Mikael Morin <[email protected]>
Date:   Sun Sep 14 13:43:25 2025 +0200

    Correction régression pdt_31

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

diff --git a/gcc/fortran/trans-descriptor.cc b/gcc/fortran/trans-descriptor.cc
index 55e2798234b4..60f6245447e8 100644
--- a/gcc/fortran/trans-descriptor.cc
+++ b/gcc/fortran/trans-descriptor.cc
@@ -2635,6 +2635,8 @@ gfc_set_pdt_array_descriptor (stmtblock_t *block, tree 
descr,
   gfc_conv_descriptor_dtype_set (block, descr,
                                 gfc_get_dtype (TREE_TYPE (descr)));
 
+  gfc_conv_descriptor_span_set (block, descr, elt_size);
+
   size = fold_build2_loc (input_location, MULT_EXPR,
                          gfc_array_index_type, size, elt_size);
   size = gfc_evaluate_now (size, block);
diff --git a/libgfortran/libgfortran.h b/libgfortran/libgfortran.h
index 70b7b40fb29d..e87989ad66eb 100644
--- a/libgfortran/libgfortran.h
+++ b/libgfortran/libgfortran.h
@@ -485,7 +485,7 @@ typedef GFC_FULL_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, 
GFC_INTEGER_4) gfc_full_a
 
 #define GFC_DESCRIPTOR_STRIDE(desc,i) ((desc)->dim[i]._stride)
 #define GFC_DESCRIPTOR_STRIDE_BYTES(desc,i) \
-  (GFC_DESCRIPTOR_STRIDE(desc,i) * GFC_DESCRIPTOR_SIZE(desc))
+  (GFC_DESCRIPTOR_STRIDE(desc,i) * GFC_DESCRIPTOR_SPAN(desc))
 
 /* Macros to get both the size and the type with a single masking operation  */

Reply via email to