https://gcc.gnu.org/g:41b07d9c969bfc99f07a33078feeddf4852d0bda

commit 41b07d9c969bfc99f07a33078feeddf4852d0bda
Author: Mikael Morin <mik...@gcc.gnu.org>
Date:   Tue Feb 4 17:03:58 2025 +0100

    Correction régression assumed_rank_21.f90

Diff:
---
 gcc/fortran/trans-array.cc | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc
index 8b34ca189f1e..6f582d34e53e 100644
--- a/gcc/fortran/trans-array.cc
+++ b/gcc/fortran/trans-array.cc
@@ -759,7 +759,7 @@ public:
     : initialisation(true), ts(nullptr), value(arg_value), use_tree_type_ 
(true) { }
   virtual bool is_initialization () const { return initialisation; }
   virtual bool initialize_data () const { return true; }
-  virtual tree get_data_value () const { return value; }
+  virtual tree get_data_value () const;
   virtual gfc_typespec *get_type () const { return ts; }
   virtual bool set_span () const { return true; }
   virtual bool use_tree_type () const { return use_tree_type_; }
@@ -768,6 +768,15 @@ public:
 };
 
 
+tree
+scalar_value::get_data_value () const
+{
+  if (POINTER_TYPE_P (TREE_TYPE (value)))
+    return value;
+  else
+    return gfc_build_addr_expr (NULL_TREE, value);
+}
+
 tree
 scalar_value::get_elt_type () const
 {

Reply via email to