[gcc(refs/users/mikael/heads/refactor_descriptor_v203.04)] Correction ISO_Fortran_binding_4

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

commit e53170dce3f5e8efe7aadd7c3be321b00d5e1318
Author: Mikael Morin <[email protected]>
Date:   Wed Jul 15 18:35:48 2026 +0200

    Correction ISO_Fortran_binding_4

Diff:
---
 gcc/fortran/trans-decl.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gcc/fortran/trans-decl.cc b/gcc/fortran/trans-decl.cc
index 47b28c1d0032..da24d6115766 100644
--- a/gcc/fortran/trans-decl.cc
+++ b/gcc/fortran/trans-decl.cc
@@ -7694,7 +7694,10 @@ gfc_conv_cfi_to_gfc (stmtblock_t *init, stmtblock_t *finally,
 			     size_var, gfc_get_cfi_desc_elem_len (cfi));
       tree call = builtin_decl_explicit (BUILT_IN_MALLOC);
       call = build_call_expr_loc (input_location, call, 1, tmp);
-      gfc_add_modify (&block2, data, fold_convert (TREE_TYPE (data), call));
+      if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (gfc_desc)))
+	gfc_conv_descriptor_data_set (&block2, gfc_desc, call);
+      else
+	gfc_add_modify (&block2, data, fold_convert (TREE_TYPE (data), call));
 
       /* Copy the data:
 	 for (idx = 0; idx < size; ++idx)
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.