https://gcc.gnu.org/g:86b472ea185c49acb7df99b275eb77321f9a4e42
commit 86b472ea185c49acb7df99b275eb77321f9a4e42 Author: Mikael Morin <mik...@gcc.gnu.org> Date: Tue Apr 29 15:42:48 2025 +0200 Correction régression alloc_comp_result_1 Diff: --- gcc/fortran/trans-array.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc index b931184a3c40..748b31059491 100644 --- a/gcc/fortran/trans-array.cc +++ b/gcc/fortran/trans-array.cc @@ -8769,6 +8769,9 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl, tree dest, { /* Otherwise use the TYPE_DOMAIN information. */ tmp = array_type_nelts_minus_one (decl_type); + if (error_operand_p (tmp) + && GFC_ARRAY_TYPE_P (decl_type)) + tmp = GFC_TYPE_ARRAY_SIZE (decl_type); tmp = fold_convert (gfc_array_index_type, tmp); }