[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:ce994e21944c08b964a53572054980f890e83b77

commit ce994e21944c08b964a53572054980f890e83b77
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 5b888e38c99c..b0895d92cb15 100644
--- a/gcc/fortran/trans-descriptor.cc
+++ b/gcc/fortran/trans-descriptor.cc
@@ -1599,7 +1599,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.  */
@@ -1650,17 +1650,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.