[gcc(refs/users/mikael/heads/refactor_descriptor_v05)] Suppression borne supérieure type si dynamique
Mikael Morin
mikael@gcc.gnu.org
Fri Jun 13 15:02:49 GMT 2025
https://gcc.gnu.org/g:cabfff09f10b3fbc60c601052dd50e84635debc3
commit cabfff09f10b3fbc60c601052dd50e84635debc3
Author: Mikael Morin <mikael@gcc.gnu.org>
Date: Wed May 7 22:21:41 2025 +0200
Suppression borne supérieure type si dynamique
Diff:
---
gcc/fortran/trans-array.cc | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc
index 37beebe2ced2..27c9adcdcd8c 100644
--- a/gcc/fortran/trans-array.cc
+++ b/gcc/fortran/trans-array.cc
@@ -1049,10 +1049,22 @@ gfc_trans_create_temp_array (stmtblock_t * pre, stmtblock_t * post, gfc_ss * ss,
}
}
- /* Initialize the descriptor. */
+ /* Clear type upper bound if dynamic. */
+ tree to0 = NULL_TREE;
+ if (dynamic && total_dim == 1)
+ {
+ to0 = to[0];
+ to[0] = NULL_TREE;
+ }
type =
gfc_get_array_type_bounds (eltype, total_dim, 0, from, to, 1,
GFC_ARRAY_UNKNOWN, true);
+ /* Restore the upper bound, for the rest (not type-related) of the descriptor
+ initialization. */
+ if (to0)
+ to[0] = to0;
+
+ /* Initialize the descriptor. */
desc = gfc_create_var (type, "atmp");
GFC_DECL_PACKED_ARRAY (desc) = 1;
More information about the Gcc-cvs
mailing list