https://gcc.gnu.org/g:fc9fe2bb7867eb937a1493841b22a2d77ee55fd2
commit fc9fe2bb7867eb937a1493841b22a2d77ee55fd2 Author: Mikael Morin <mik...@gcc.gnu.org> Date: Wed Feb 19 20:06:10 2025 +0100 Correction initialisation bornes temp alloc_comp_assign_12.f03 Diff: --- gcc/fortran/trans-array.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc index e05893e42564..e4c581813e02 100644 --- a/gcc/fortran/trans-array.cc +++ b/gcc/fortran/trans-array.cc @@ -3672,7 +3672,7 @@ set_temporary_descriptor (stmtblock_t *block, tree desc, tree class_src, tree lbound[GFC_MAX_DIMENSIONS], tree ubound[GFC_MAX_DIMENSIONS], tree stride[GFC_MAX_DIMENSIONS], int rank, - bool callee_allocated, bool rank_changer, + bool omit_bounds, bool rank_changer, bool shift_bounds) { int n; @@ -3700,7 +3700,7 @@ set_temporary_descriptor (stmtblock_t *block, tree desc, tree class_src, } tree offset = gfc_index_zero_node; - if (!callee_allocated) + if (!omit_bounds) { for (n = 0; n < rank; n++) { @@ -4032,6 +4032,8 @@ gfc_trans_create_temp_array (stmtblock_t * pre, stmtblock_t * post, gfc_ss * ss, } } + bool bounds_known = size != NULL_TREE; + /* Get the size of the array. */ if (size && !callee_alloc) { @@ -4055,8 +4057,7 @@ gfc_trans_create_temp_array (stmtblock_t * pre, stmtblock_t * post, gfc_ss * ss, dealloc); set_temporary_descriptor (pre, desc, class_expr, elemsize, data_ptr, - from, to, stride, total_dim, - size == NULL_TREE || callee_alloc, + from, to, stride, total_dim, !bounds_known, rank_changer, shift_bounds); while (ss->parent)