[gcc(refs/users/mikael/heads/refactor_descriptor_v05)] Correction régression realloc_on_assign_16.f90

Mikael Morin mikael@gcc.gnu.org
Fri Jun 13 14:56:13 GMT 2025


https://gcc.gnu.org/g:3d71784a24d988db89420ee2fa94d1afc5f50158

commit 3d71784a24d988db89420ee2fa94d1afc5f50158
Author: Mikael Morin <mikael@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 1d76b86d0040..8350173648a5 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 ce06448f4b9d..39d29fd73e65 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];


More information about the Gcc-cvs mailing list