From 753721a542a5814d038bf7a01422aebd5ace6ff3 Mon Sep 17 00:00:00 2001 From: Paul Thomas Date: Tue, 28 Feb 2017 19:32:02 +0000 Subject: [PATCH] re PR fortran/79739 (ICE with some interesting code) 2017-02-28 Paul Thomas PR fortran/79739 * resolve.c (resolve_fl_procedure): Deal with the case where 'submodule_name' is NULL so that gfc_error does not ICE. Reformat the error message to make it more consistent. From-SVN: r245787 --- gcc/fortran/ChangeLog | 7 +++++++ gcc/fortran/resolve.c | 7 ++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index e9432d2cd91..3e4fde16764 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2017-02-28 Paul Thomas + + PR fortran/79739 + * resolve.c (resolve_fl_procedure): Deal with the case where + 'submodule_name' is NULL so that gfc_error does not ICE. + Reformat the error message to make it more consistent. + 2017-02-28 Jakub Jelinek * parse.c (parse_critical_block): Use cond ? G_("...") : G_("...") diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 876f3cd5d8c..37ffde820e0 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -12341,9 +12341,10 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag) if (!gfc_check_result_characteristics (sym, iface, errmsg, 200)) { gfc_error ("%s between the MODULE PROCEDURE declaration " - "in module %s and the declaration at %L in " - "SUBMODULE %s", errmsg, module_name, - &sym->declared_at, submodule_name); + "in MODULE '%s' and the declaration at %L in " + "(SUB)MODULE '%s'", + errmsg, module_name, &sym->declared_at, + submodule_name ? submodule_name : module_name); return false; } -- 2.30.2