[gcc(refs/users/mikael/heads/refactor_descriptor_v291 .01)] Renseignement dtype par défaut

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

commit a9b2dced2879bc522774764678eaeca8e5af249e
Author: Mikael Morin <[email protected]>
Date:   Sun Aug 10 22:54:58 2025 +0200

    Renseignement dtype par défaut
    
    Revert "Correction PR100094"
    
    This reverts commit c0d877bc00edfd11cd0332c72cf0650e4ad8f948.
    
    Revert "Correction initialisation write_destination"
    
    This reverts commit 38bbc288025a34431268a17efee4231bff1a32d3.
    
    Revert "Non renseignement dtype par défaut"
    
    This reverts commit 8af77250f7e46d9913e6f2b44ac4bbac4c9fd1db.

Diff:
---
 gcc/fortran/trans-array.cc      | 6 ++----
 gcc/fortran/trans-descriptor.cc | 5 ++---
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc
index 8a98b409555d..4d42fee58883 100644
--- a/gcc/fortran/trans-array.cc
+++ b/gcc/fortran/trans-array.cc
@@ -12444,12 +12444,10 @@ gfc_trans_deferred_array (gfc_symbol * sym, gfc_wrapped_block * block)
 
   /* NULLIFY the data pointer for non-saved allocatables, or for non-saved
      pointers when -fcheck=pointer is specified.  */
-  if (GFC_DESCRIPTOR_TYPE_P (type)
+  if (GFC_DESCRIPTOR_TYPE_P (type) && !sym->attr.save
       && (sym->attr.allocatable || sym->attr.pointer))
     {
-      if (flag_coarray == GFC_FCOARRAY_LIB
-	  && sym->attr.codimension
-	  && !sym->attr.save)
+      if (flag_coarray == GFC_FCOARRAY_LIB && sym->attr.codimension)
 	{
 	  /* Declare the variable static so its array descriptor stays present
 	     after leaving the scope.  It may still be accessed through another
diff --git a/gcc/fortran/trans-descriptor.cc b/gcc/fortran/trans-descriptor.cc
index 2fefc3207fef..cd1658b73ff3 100644
--- a/gcc/fortran/trans-descriptor.cc
+++ b/gcc/fortran/trans-descriptor.cc
@@ -912,9 +912,8 @@ gfc_init_descriptor_variable (stmtblock_t *block, gfc_symbol *sym, tree descr)
 {
   /* NULLIFY the data pointer for non-saved allocatables, or for non-saved
      pointers when -fcheck=pointer is specified.  */
-  if (!sym->attr.save
-      && (sym->attr.allocatable
-	  || (sym->attr.pointer && (gfc_option.rtcheck & GFC_RTCHECK_POINTER))))
+  if (sym->attr.allocatable
+      || (sym->attr.pointer && (gfc_option.rtcheck & GFC_RTCHECK_POINTER)))
     {
       gfc_conv_descriptor_data_set (block, descr, null_pointer_node);
       if (flag_coarray == GFC_FCOARRAY_LIB && sym->attr.codimension)
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.