https://gcc.gnu.org/g:0be4fe0958cc995e44e13b88e2cb8c5dc52a3ee6
commit 0be4fe0958cc995e44e13b88e2cb8c5dc52a3ee6 Author: Mikael Morin <[email protected]> Date: Wed Jul 15 18:25:58 2026 +0200 Correction allocate_with_mold_6 Diff: --- gcc/fortran/trans-array.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc index 3075cae8b6c4..382f40b7d334 100644 --- a/gcc/fortran/trans-array.cc +++ b/gcc/fortran/trans-array.cc @@ -10693,8 +10693,11 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl, tree dest, { ftn_tree = builtin_decl_explicit (BUILT_IN_MALLOC); tmp = build_call_expr_loc (input_location, ftn_tree, 1, size); - gfc_add_modify (&tmpblock, dst_data, - fold_convert (TREE_TYPE (dst_data), tmp)); + if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (dst_data))) + gfc_conv_descriptor_data_set (&tmpblock, dst_data, tmp); + else + gfc_add_modify (&tmpblock, dst_data, + fold_convert (TREE_TYPE (dst_data), tmp)); } tmp = gfc_copy_class_to_class (comp, dcmp, nelems,
