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

commit e5b446f1609cc213d9b362241bb1f5ba1d537c90
Author: Mikael Morin <[email protected]>
Date:   Tue Aug 18 14:37:48 2026 +0200

    fortran: array descriptor: Factor scalar descriptor init 2/2 [PR122521]
    
    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.

Diff:
---
 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 6ea4a1565c69..a6136b220151 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);
 }

Reply via email to