https://gcc.gnu.org/g:9b01c6db792c0446612a86b58549d13ca365c5a6

commit 9b01c6db792c0446612a86b58549d13ca365c5a6
Author: Mikael Morin <mik...@gcc.gnu.org>
Date:   Sun Aug 10 20:56:19 2025 +0200

    Non renseignement dtype par défaut
    
    Correction initialisation write_destination

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

diff --git a/gcc/fortran/trans-descriptor.cc b/gcc/fortran/trans-descriptor.cc
index 7ab26b5a05ad..799a8e69c000 100644
--- a/gcc/fortran/trans-descriptor.cc
+++ b/gcc/fortran/trans-descriptor.cc
@@ -716,7 +716,7 @@ class constructor_elements
   bool constant;
 
 public:
-  constructor_elements () : values(NULL), constant(true) {}
+  constructor_elements () : values(nullptr), constant(true) {}
   void add_value (tree elt, tree val);
   tree build (tree type);
 };
@@ -770,8 +770,8 @@ struct write_destination
   }
   u;
 
-  write_destination (tree r, stmtblock_t *b) : ref(r), u(b) {}
-  write_destination (tree d) : ref(d), u() {}
+  write_destination (tree r, stmtblock_t *b) : type (REGULAR_ASSIGN), ref (r), 
u (b) {}
+  write_destination (tree d) : type (STATIC_INIT), ref(d), u() {}
 };
 
 
@@ -951,13 +951,11 @@ gfc_init_descriptor_variable (stmtblock_t *block, 
gfc_symbol *sym, tree descr)
       gfc_conv_descriptor_data_set (block, descr, null_pointer_node);
       if (flag_coarray == GFC_FCOARRAY_LIB && sym->attr.codimension)
        gfc_conv_descriptor_token_set (block, descr, null_pointer_node);
-    }
-
-  tree etype;
 
-  gcc_assert (sym->as && sym->as->rank>=0);
-  etype = gfc_get_element_type (TREE_TYPE (descr));
-  gfc_conv_descriptor_dtype_set (block, descr,
-                                gfc_get_dtype_rank_type (sym->as->rank,
-                                                         etype));
+      gcc_assert (sym->as && sym->as->rank>=0);
+      tree etype = gfc_get_element_type (TREE_TYPE (descr));
+      gfc_conv_descriptor_dtype_set (block, descr,
+                                    gfc_get_dtype_rank_type (sym->as->rank,
+                                                             etype));
+    }
 }

Reply via email to