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

commit aeebeea614379f6f2c5aa279e1e4979031327a21
Author: Mikael Morin <mik...@gcc.gnu.org>
Date:   Thu Apr 17 17:22:26 2025 +0200

    Correction régression realloc_on_assign_16.f90

Diff:
---
 gcc/fortran/trans-array.cc | 10 ++--------
 gcc/fortran/trans.h        |  2 --
 2 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc
index 81466a0cde75..5d2e2e3132bc 100644
--- a/gcc/fortran/trans-array.cc
+++ b/gcc/fortran/trans-array.cc
@@ -3524,8 +3524,8 @@ gfc_conv_scalarized_array_ref (gfc_se * se, gfc_array_ref 
* ar, bool tmp_array =
   tree index = conv_array_index (se, ss, ss->dim[n], n, ar);
 
   gfc_array_info *info = &ss->info->data.array;
-  se->expr = build_array_ref_dim (ss, index, info->spacing0, info->offset,
-                                 tmp_array);
+  se->expr = build_array_ref_dim (ss, index, info->spacing[ss->dim[n]],
+                                 info->offset, tmp_array);
 }
 
 
@@ -3803,12 +3803,6 @@ gfc_trans_preloop_setup (gfc_loopinfo * loop, int dim, 
int flag,
        {
          gcc_assert (0 == ploop->order[0]);
 
-         info->spacing0 = gfc_conv_array_spacing (info->descriptor, 0);
-         /* Calculate the spacing of the innermost loop.  Hopefully this will
-            allow the backend optimizers to do their stuff more effectively.
-          */
-         info->spacing0 = gfc_evaluate_now (info->spacing0, pblock);
-
          if (info->ref)
            {
              for (int i = ar->dimen - 1; i >= 0; i--)
diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h
index a232254fd63f..a7054571e24f 100644
--- a/gcc/fortran/trans.h
+++ b/gcc/fortran/trans.h
@@ -201,8 +201,6 @@ typedef struct gfc_array_info
   /* To move some of the array index calculation out of the innermost loop.  */
   tree offset;
 
-  tree spacing0;
-
   /* Holds the SS for a subscript.  Indexed by actual dimension.  */
   struct gfc_ss *subscript[GFC_MAX_DIMENSIONS];

Reply via email to