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

commit a1657ba13a58d906b7dcd3376000504b9cba2453
Author: Mikael Morin <mik...@gcc.gnu.org>
Date:   Fri Apr 4 20:46:14 2025 +0200

    Sauvegarde correction régressions.

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

diff --git a/gcc/fortran/trans-descriptor.cc b/gcc/fortran/trans-descriptor.cc
index 747e98d05df5..b1516e640625 100644
--- a/gcc/fortran/trans-descriptor.cc
+++ b/gcc/fortran/trans-descriptor.cc
@@ -614,7 +614,9 @@ conv_spacing_get (tree desc, tree dim)
          || GFC_TYPE_ARRAY_AKIND (type) == GFC_ARRAY_ASSUMED_RANK_ALLOCATABLE
          || GFC_TYPE_ARRAY_AKIND (type) == GFC_ARRAY_ASSUMED_RANK_POINTER_CONT
          || GFC_TYPE_ARRAY_AKIND (type) == GFC_ARRAY_POINTER_CONT))
-    return conv_span_get (desc);
+    return fold_build2_loc (input_location, EXACT_DIV_EXPR,
+                           gfc_array_index_type, conv_span_get (desc),
+                           GFC_TYPE_ARRAY_ALIGN (TREE_TYPE (desc)));
 
   return non_lvalue_loc (input_location, get_spacing (desc, dim));
 }
@@ -3539,7 +3541,7 @@ gfc_descr_init_count (tree descriptor, int rank, int 
corank, gfc_expr ** lower,
   gfc_conv_descriptor_span_set (descriptor_block, descriptor, tmp);
 
   gfc_conv_descriptor_align_set (descriptor_block, descriptor,
-                                TYPE_ALIGN (gfc_get_element_type (TREE_TYPE 
(descriptor))));
+                                TYPE_ALIGN_UNIT(gfc_get_element_type 
(TREE_TYPE (descriptor))));
 
   return gfc_evaluate_now (stride, pblock);
 }

Reply via email to