https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110658

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |anlauf at gcc dot 
gnu.org
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-07-16
             Status|UNCONFIRMED                 |ASSIGNED

--- Comment #1 from anlauf at gcc dot gnu.org ---
I am testing the following patch:

diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc
index dbb04f8c434..e783dbb64b1 100644
--- a/gcc/fortran/trans-expr.cc
+++ b/gcc/fortran/trans-expr.cc
@@ -7654,7 +7654,12 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
             (and other intrinsics?) and dummy functions.  In the case of
SPREAD,
             we take the character length of the first argument for the result.
             For dummies, we have to look through the formal argument list for
-            this function and use the character length found there.*/
+            this function and use the character length found there.
+            Likewise, we handle the case of deferred-length character dummy
+            arguments to intrinsics that determine the characteristics of
+            the result, which cannot be deferred-length.  */
+         if (expr->value.function.isym)
+           ts.deferred = false;
          if (ts.deferred)
            cl.backend_decl = gfc_create_var (gfc_charlen_type_node, "slen");
          else if (!sym->attr.dummy)

Reply via email to