https://gcc.gnu.org/g:b0bcdcaf3cca79ff4e9285edaece7575de45f564
commit b0bcdcaf3cca79ff4e9285edaece7575de45f564 Author: Mikael Morin <mik...@gcc.gnu.org> Date: Mon Jul 7 14:38:51 2025 +0200 Ajout commentaire Diff: --- gcc/fortran/trans-array.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc index 3cd6d90f47e7..abf535cdaedb 100644 --- a/gcc/fortran/trans-array.cc +++ b/gcc/fortran/trans-array.cc @@ -11352,6 +11352,19 @@ concat_str_length (gfc_expr* expr) } +/* Among the scalarization chain of LOOP, find the element associated with an + allocatable array on the lhs of an assignment and evaluate its fields + (bounds, offset, etc) to new variables, putting the new code in BLOCK. This + function is to be called after putting the reallocation code in BLOCK and + before the beginning of the scalarization loop body. + + The fields to be saved are expected to hold on entry to the function + expressions referencing the array descriptor. Especially the expressions + shouldn't be already temporary variable references as the value saved before + reallocation would be incorrect after reallocation. + At the end of the function, the expressions have been replaced with variable + references. */ + static void update_reallocated_descriptor (stmtblock_t *block, gfc_loopinfo *loop) {