[gcc(refs/users/mikael/heads/refactor_descriptor_v291.01)] Refactor set_dimension_fields set_empty_descriptor

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

commit e768e6e543831747825638b49c7ca54f508d8774
Author: Mikael Morin <[email protected]>
Date:   Sat Aug 16 19:17:56 2025 +0200

    Refactor set_dimension_fields set_empty_descriptor

Diff:
---
 gcc/fortran/trans-descriptor.cc | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/gcc/fortran/trans-descriptor.cc b/gcc/fortran/trans-descriptor.cc
index e76b10386d3b..1f800129640f 100644
--- a/gcc/fortran/trans-descriptor.cc
+++ b/gcc/fortran/trans-descriptor.cc
@@ -2934,15 +2934,10 @@ gfc_descriptor_init_count (tree descriptor, int rank, int corank,
 void
 gfc_set_empty_descriptor_bounds (stmtblock_t *block, tree descr, int rank)
 {
+  tree offset = gfc_index_zero_node;
   for (int n = 0; n < rank; n++)
-    {
-      gfc_conv_descriptor_lbound_set (block, descr, gfc_rank_cst[n],
-				      gfc_index_one_node);
-      gfc_conv_descriptor_ubound_set (block, descr, gfc_rank_cst[n],
-				      gfc_index_zero_node);
-      gfc_conv_descriptor_stride_set (block, descr, gfc_rank_cst[n],
-				      gfc_index_zero_node);
-    }
+    set_dimension_fields (block, descr, gfc_rank_cst[n], gfc_index_one_node,
+			  gfc_index_zero_node, gfc_index_zero_node, &offset);
 
   gfc_conv_descriptor_offset_set (block, descr, gfc_index_zero_node);
 }
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.