[gcc(refs/users/mikael/heads/refactor_descriptor_v291.01)] Calcul offset sans passer par le descripteur

Mikael Morin via Gcc-cvs <[email protected]>
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:3276aa0c0bef0a140e46bf67ce6a4ec48400cfe1

commit 3276aa0c0bef0a140e46bf67ce6a4ec48400cfe1
Author: Mikael Morin <[email protected]>
Date:   Sat Aug 16 16:17:52 2025 +0200

    Calcul offset sans passer par le descripteur

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

diff --git a/gcc/fortran/trans-descriptor.cc b/gcc/fortran/trans-descriptor.cc
index a4e619423a24..bf7ba3d2c76d 100644
--- a/gcc/fortran/trans-descriptor.cc
+++ b/gcc/fortran/trans-descriptor.cc
@@ -1584,7 +1584,7 @@ gfc_conv_remap_descriptor (stmtblock_t *block, tree dest, int dest_rank,
 
   /* Copy offset but adjust it such that it would correspond
      to a lbound of zero.  */
-  gfc_conv_descriptor_offset_set (block, dest, gfc_index_zero_node);
+  tree offset = gfc_index_zero_node;
 
   /* Set the bounds as declared for the LHS and calculate strides as
      well as another offset update accordingly.  */
@@ -1635,17 +1635,15 @@ gfc_conv_remap_descriptor (stmtblock_t *block, tree dest, int dest_rank,
       gfc_conv_descriptor_stride_set (block, dest, gfc_rank_cst[dim], stride);
 
       /* Update offset.  */
-      tree offs = gfc_conv_descriptor_offset_get (dest);
       tree tmp = fold_build2_loc (input_location, MULT_EXPR,
 				  gfc_array_index_type, lbound, stride);
-      offs = fold_build2_loc (input_location, MINUS_EXPR,
-			      gfc_array_index_type, offs, tmp);
-      offs = gfc_evaluate_now (offs, block);
-      gfc_conv_descriptor_offset_set (block, dest, offs);
+      offset = fold_build2_loc (input_location, MINUS_EXPR,
+				gfc_array_index_type, offset, tmp);
 
       /* Update stride.  */
       tmp = gfc_conv_array_extent_dim (lbound, ubound, NULL);
       stride = fold_build2_loc (input_location, MULT_EXPR,
 				gfc_array_index_type, stride, tmp);
     }
+  gfc_conv_descriptor_offset_set (block, dest, offset);
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.