[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:8e7485e6aab5e7d27ed2d04649a539052dcaa23b

commit 8e7485e6aab5e7d27ed2d04649a539052dcaa23b
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 54514aad47c2..6c01279519be 100644
--- a/gcc/fortran/trans-descriptor.cc
+++ b/gcc/fortran/trans-descriptor.cc
@@ -2919,15 +2919,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.