https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102900
--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Harald Anlauf <anl...@gcc.gnu.org>: https://gcc.gnu.org/g:cc8d86ee4680d56eefeb76a8f2f752282e2631e3 commit r16-150-gcc8d86ee4680d56eefeb76a8f2f752282e2631e3 Author: Harald Anlauf <anl...@gmx.de> Date: Thu Apr 24 21:28:35 2025 +0200 Fortran: fix procedure pointer handling with -fcheck=pointer [PR102900] PR fortran/102900 gcc/fortran/ChangeLog: * trans-decl.cc (gfc_generate_function_code): Use sym->result when generating fake result decl for functions returning allocatable or pointer results. * trans-expr.cc (gfc_conv_procedure_call): When checking the pointer status of an actual argument passed to a non-allocatable, non-pointer dummy which is of type CLASS, do not check the class container of the actual if it is just a procedure pointer. (gfc_trans_pointer_assignment): Fix treatment of assignment to NULL of a procedure pointer. gcc/testsuite/ChangeLog: * gfortran.dg/proc_ptr_52.f90: Add -fcheck=pointer to options. * gfortran.dg/proc_ptr_57.f90: New test.