https://gcc.gnu.org/g:a181d00d8a0e0347bfba8dff5831a682e03ed431

commit a181d00d8a0e0347bfba8dff5831a682e03ed431
Author: Mikael Morin <mik...@gcc.gnu.org>
Date:   Fri Mar 14 18:40:40 2025 +0100

    Correction régression assumed_rank_20.f90

Diff:
---
 gcc/fortran/trans-array.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc
index b8fc0c4bea3e..98dee213ca1a 100644
--- a/gcc/fortran/trans-array.cc
+++ b/gcc/fortran/trans-array.cc
@@ -1132,7 +1132,7 @@ private:
 
 public:
   default_init (const symbol_attribute &arg_attr) : attr(arg_attr) { }
-  virtual bool initialize_data () const { return !attr.pointer; }
+  virtual bool initialize_data () const { return !attr.pointer || 
(gfc_option.rtcheck & GFC_RTCHECK_POINTER); }
   virtual tree get_data_value () const {
     if (!initialize_data ())
       return NULL_TREE;
@@ -14469,7 +14469,7 @@ gfc_trans_deferred_array (gfc_symbol * sym, 
gfc_wrapped_block * block)
      pointers when -fcheck=pointer is specified.  */
   if (GFC_DESCRIPTOR_TYPE_P (type) && !sym->attr.save
       && (sym->attr.allocatable
-         || (sym->attr.pointer && (gfc_option.rtcheck & GFC_RTCHECK_POINTER))))
+         || sym->attr.pointer))
     {
       /* Declare the variable static so its array descriptor stays present
         after leaving the scope.  It may still be accessed through another

Reply via email to