[gcc(refs/users/mikael/heads/refactor_descriptor_v291.01)] Factorisation set_dimension_fields gfc_set_descriptor

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

commit ec65bba52299e5611144deda5b9b80e09b295f1e
Author: Mikael Morin <[email protected]>
Date:   Sat Aug 16 18:11:01 2025 +0200

    Factorisation set_dimension_fields gfc_set_descriptor

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

diff --git a/gcc/fortran/trans-descriptor.cc b/gcc/fortran/trans-descriptor.cc
index 0302edddf1af..9e9e7931a9e5 100644
--- a/gcc/fortran/trans-descriptor.cc
+++ b/gcc/fortran/trans-descriptor.cc
@@ -1861,27 +1861,14 @@ gfc_set_descriptor (stmtblock_t *block, tree dest, tree src, gfc_expr *src_expr,
       tree from = lowers[dim];
       tree to = uppers[dim];
 
-      gfc_conv_descriptor_lbound_set (block, dest,
-				      gfc_rank_cst[dim], from);
-
-      /* Set the new upper bound.  */
-      gfc_conv_descriptor_ubound_set (block, dest,
-				      gfc_rank_cst[dim], to);
-
       /* Multiply the stride by the section stride to get the
 	 total stride.  */
       stride = fold_build2_loc (input_location, MULT_EXPR,
 				gfc_array_index_type,
 				stride, info->stride[n]);
 
-      tmp = fold_build2_loc (input_location, MULT_EXPR,
-			     TREE_TYPE (offset), stride, from);
-      offset = fold_build2_loc (input_location, MINUS_EXPR,
-			       TREE_TYPE (offset), offset, tmp);
-
-      /* Store the new stride.  */
-      gfc_conv_descriptor_stride_set (block, dest,
-				      gfc_rank_cst[dim], stride);
+      set_dimension_fields (block, dest, gfc_rank_cst[dim], from, to, stride,
+			    &offset);
     }
 
   /* For deferred-length character we need to take the dynamic length
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.