https://gcc.gnu.org/g:1e590085850cdba46f66fdc8a90adfa40f615eed
commit 1e590085850cdba46f66fdc8a90adfa40f615eed Author: Mikael Morin <mik...@gcc.gnu.org> 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 d16127cf3ed7..ce7495ab1f34 100644 --- a/gcc/fortran/trans-descriptor.cc +++ b/gcc/fortran/trans-descriptor.cc @@ -1860,27 +1860,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 (int n = rank; n < rank + corank; n++)