https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90813
--- Comment #34 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- Author: tkoenig Date: Tue Jul 30 19:11:03 2019 New Revision: 273913 URL: https://gcc.gnu.org/viewcvs?rev=273913&root=gcc&view=rev Log: 2019-07-29 Thomas Koenig <tkoe...@gcc.gnu.org> Paul Thomas <pa...@gcc.gnu.org> Backport from trunk PR fortran/90786 PR fortran/90813 * trans-expr.c (pointer_assignment_is_proc_pointer) Remove as it is very simple and only called from one place. (gfc_trans_pointer_assignment): Rename non_proc_pointer_assign as non_proc_ptr_assign. Assign to it directly, rather than call to above, deleted function and use gfc_expr_attr instead of only checking the reference chain. * dump-parse-tree.c (show_global_symbol): New function. (gfc_dump_global_symbols): New function. * gfortran.h (gfc_traverse_gsymbol): Add prototype. (gfc_dump_global_symbols): Likewise. * invoke.texi: Document -fdump-fortran-global. * lang.opt: Add -fdump-fortran-global. * parse.c (gfc_parse_file): Handle flag_dump_fortran_global. * symbol.c (gfc_traverse_gsymbol): New function. * trans-decl.c (sym_identifier): New function. (mangled_identifier): New function, doing most of the work of gfc_sym_mangled_identifier. (gfc_sym_mangled_identifier): Use mangled_identifier. Add mangled identifier to global symbol table. (get_proc_pointer_decl): Use backend decl from global identifier if present. 2019-07-29 Thomas Koenig <tkoe...@gcc.gnu.org> Paul Thomas <pa...@gcc.gnu.org> Backport from trunk PR fortran/90786 PR fortran/90813 * gfortran.dg/proc_ptr_51.f90: New test. Added: branches/gcc-9-branch/gcc/testsuite/gfortran.dg/proc_ptr_51.f90 Modified: branches/gcc-9-branch/gcc/fortran/ChangeLog branches/gcc-9-branch/gcc/fortran/dump-parse-tree.c branches/gcc-9-branch/gcc/fortran/gfortran.h branches/gcc-9-branch/gcc/fortran/invoke.texi branches/gcc-9-branch/gcc/fortran/lang.opt branches/gcc-9-branch/gcc/fortran/parse.c branches/gcc-9-branch/gcc/fortran/symbol.c branches/gcc-9-branch/gcc/fortran/trans-decl.c branches/gcc-9-branch/gcc/fortran/trans-expr.c branches/gcc-9-branch/gcc/testsuite/ChangeLog