From: Mikael Morin <[email protected]>

Fortran-tested on aarch64-unknown-linux-gnu.  OK for mainline?

-- >8 --

The static function set_descriptor_from_scalar is already used as
implementation detail by two of the three scalar descriptor initialization
functions.  Use it as well in the third one.

        PR fortran/122521

gcc/fortran/ChangeLog:

        * trans-descriptor.cc (gfc_set_descriptor_from_scalar): Replace
        inline code with call to set_descriptor_from_scalar.
---
 gcc/fortran/trans-descriptor.cc | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/gcc/fortran/trans-descriptor.cc b/gcc/fortran/trans-descriptor.cc
index 6ea4a1565c6..a6136b22015 100644
--- a/gcc/fortran/trans-descriptor.cc
+++ b/gcc/fortran/trans-descriptor.cc
@@ -901,10 +901,7 @@ gfc_set_descriptor_from_scalar (stmtblock_t *block, tree 
descr, tree scalar)
   tree etype = TREE_TYPE (scalar);
   if (!POINTER_TYPE_P (TREE_TYPE (scalar)))
     scalar = gfc_build_addr_expr (NULL_TREE, scalar);
-
-  gfc_conv_descriptor_dtype_set (block, descr,
-                                gfc_get_dtype_rank_type (0, etype));
-  gfc_conv_descriptor_data_set (block, descr, scalar);
+  set_descriptor_from_scalar (block, descr, etype, scalar, NULL_TREE);
 }
 
 
-- 
2.53.0

Reply via email to