[gcc(refs/users/mikael/heads/refactor_descriptor_v05)] Correction régression pr59586
Mikael Morin
mikael@gcc.gnu.org
Fri Jun 13 14:58:32 GMT 2025
https://gcc.gnu.org/g:c6f1e515954198a94f8fe85233f7e26fe23360b3
commit c6f1e515954198a94f8fe85233f7e26fe23360b3
Author: Mikael Morin <mikael@gcc.gnu.org>
Date: Thu Apr 24 20:53:34 2025 +0200
Correction régression pr59586
Diff:
---
gcc/fortran/trans-decl.cc | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/gcc/fortran/trans-decl.cc b/gcc/fortran/trans-decl.cc
index aaa0e4af1fce..c694baae662f 100644
--- a/gcc/fortran/trans-decl.cc
+++ b/gcc/fortran/trans-decl.cc
@@ -1257,6 +1257,26 @@ gfc_build_qualified_array (tree decl, gfc_symbol * sym)
GFC_TYPE_ARRAY_SIZE (type) = create_index_var ("size", nest);
suppress_warning (GFC_TYPE_ARRAY_SIZE (type));
}
+
+ if (POINTER_TYPE_P (type))
+ {
+ gcc_assert (GFC_ARRAY_TYPE_P (TREE_TYPE (type)));
+ gcc_assert (TYPE_LANG_SPECIFIC (type)
+ == TYPE_LANG_SPECIFIC (TREE_TYPE (type)));
+ type = TREE_TYPE (type);
+ }
+
+ if (! COMPLETE_TYPE_P (type) && GFC_TYPE_ARRAY_SIZE (type))
+ {
+ tree size, range;
+
+ size = fold_build2_loc (input_location, MINUS_EXPR, gfc_array_index_type,
+ GFC_TYPE_ARRAY_SIZE (type), gfc_index_one_node);
+ range = build_range_type (gfc_array_index_type, gfc_index_zero_node,
+ size);
+ TYPE_DOMAIN (type) = range;
+ layout_type (type);
+ }
}
More information about the Gcc-cvs
mailing list