https://gcc.gnu.org/g:b2a4e5c28a2ba72041355af803de1b8be61e9853

commit b2a4e5c28a2ba72041355af803de1b8be61e9853
Author: Mikael Morin <[email protected]>
Date:   Tue Oct 7 21:46:10 2025 +0200

    Correction régression char_result_13.f90

Diff:
---
 gcc/fortran/trans-array.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc
index eccb97f1878b..70a822154a4e 100644
--- a/gcc/fortran/trans-array.cc
+++ b/gcc/fortran/trans-array.cc
@@ -8204,7 +8204,9 @@ gfc_conv_expr_descriptor (gfc_se *se, gfc_expr *expr)
       /* Set the string_length for a character array.  */
       if (expr->ts.type == BT_CHARACTER)
        {
-         if (deferred_array_component && !substr)
+         if (!substr
+             && (deferred_array_component
+                 || ss_type == GFC_SS_FUNCTION))
            se->string_length = ss_info->string_length;
          else
            se->string_length =  gfc_get_expr_charlen (expr);

Reply via email to