https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104819
--- Comment #17 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-14 branch has been updated by Harald Anlauf <anl...@gcc.gnu.org>: https://gcc.gnu.org/g:9fd8cd1990e0f5bac416bafc8a588d05c735f000 commit r14-10965-g9fd8cd1990e0f5bac416bafc8a588d05c735f000 Author: Harald Anlauf <anl...@gmx.de> Date: Thu Nov 14 21:38:04 2024 +0100 Fortran: fix passing of NULL() actual argument to character dummy [PR104819] Ensure that character length is set and passed by the call to a procedure when its dummy argument is NULL() with MOLD argument present, or set length to either 0 or the callee's expected character length. For assumed-rank dummies, use the rank of the MOLD argument. Generate temporaries for passed arguments when needed. PR fortran/104819 gcc/fortran/ChangeLog: * trans-expr.cc (conv_null_actual): Helper function to handle passing of NULL() to non-optional dummy arguments of non-bind(c) procedures. (gfc_conv_procedure_call): Use it for character dummies. gcc/testsuite/ChangeLog: * gfortran.dg/null_actual_6.f90: New test. (cherry picked from commit f70c1d517e09c4dde421774a8cec591ca3c479a0)