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

commit fd7a63a755f59828b4d69d4a1b97e5c933f88ec5
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 1db6b69d8df3..d2380ad37a6b 100644
--- a/gcc/fortran/trans-array.cc
+++ b/gcc/fortran/trans-array.cc
@@ -8888,6 +8888,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);
        }

Reply via email to