https://gcc.gnu.org/g:5fce1a3d85902ae7a999b18453c7baf3d9b1bf3b
commit 5fce1a3d85902ae7a999b18453c7baf3d9b1bf3b Author: Mikael Morin <[email protected]> Date: Wed Oct 1 14:16:22 2025 +0200 Correction régression char_spread_1.f90 Diff: --- gcc/fortran/trans-array.cc | 11 +++++++++++ gcc/fortran/trans-expr.cc | 6 ++++-- gcc/fortran/trans.h | 2 ++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc index 4768c5fede31..8bed900f6b84 100644 --- a/gcc/fortran/trans-array.cc +++ b/gcc/fortran/trans-array.cc @@ -2806,6 +2806,7 @@ gfc_add_loop_ss_code (gfc_loopinfo * loop, gfc_ss * ss, bool subscript, gfc_init_se (&se, NULL); se.loop = loop; se.ss = ss; + se.bytes_strided = info->bytes_strided; bool class_func = gfc_is_class_array_function (expr); if (class_func) expr->must_finalize = 1; @@ -8003,6 +8004,16 @@ gfc_conv_expr_descriptor (gfc_se *se, gfc_expr *expr) gcc_assert (loop.temp_ss->dimen == loop.dimen); gfc_add_ss_to_loop (&loop, loop.temp_ss); } + else if (ss + && ss != gfc_ss_terminator + && ss->next == gfc_ss_terminator) + { + gfc_ss_type ss_type = ss->info->type; + gcc_assert (ss_type != GFC_SS_SCALAR + && ss_type != GFC_SS_REFERENCE + && ss_type != GFC_SS_TEMP); + info->bytes_strided = se->bytes_strided; + } gfc_conv_loop_setup (&loop, & expr->where); diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc index acd720202752..78ad5c75fec1 100644 --- a/gcc/fortran/trans-expr.cc +++ b/gcc/fortran/trans-expr.cc @@ -8322,7 +8322,8 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, tmp, NULL_TREE, false, !comp->attr.pointer, callee_alloc, &se->ss->info->expr->where, true, - !IS_POINTER (comp)); + !IS_POINTER (comp) + && !se->bytes_strided); /* Pass the temporary as the first argument. */ result = info->descriptor; @@ -8359,7 +8360,8 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, tmp, NULL_TREE, false, !sym->attr.pointer, callee_alloc, &se->ss->info->expr->where, true, - !IS_POINTER (sym)); + !IS_POINTER (sym) + && !se->bytes_strided); /* Pass the temporary as the first argument. */ result = info->descriptor; diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h index 7c99230c8ed5..4a8c46d81810 100644 --- a/gcc/fortran/trans.h +++ b/gcc/fortran/trans.h @@ -232,6 +232,8 @@ typedef struct gfc_array_info tree delta[GFC_MAX_DIMENSIONS]; struct gfc_array_ref_info current_elem; + + bool bytes_strided; } gfc_array_info;
