From: Harald Anlauf Date: Wed, 26 Dec 2018 20:37:28 +0000 (+0000) Subject: re PR fortran/85407 (Replace gcc_assert in module.c:read_module by more helpful diagn... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2b8c2e7fb1953195df63a47fbd0c23d7db3ee5ae;p=gcc.git re PR fortran/85407 (Replace gcc_assert in module.c:read_module by more helpful diagnostics) 2018-12-26 Harald Anlauf PR fortran/85407 * module.c (read_module): Convert assert to fatal error to give user a sensible error message. From-SVN: r267422 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index a93b99ee333..af5467f8fa4 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2018-12-26 Harald Anlauf + + PR fortran/85407 + * module.c (read_module): Convert assert to fatal error to give a + sensible error message. + 2018-12-24 Steven G. Kargl PR fortran/45513 diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index 163b3ceebb2..4cfedf6a153 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -5180,7 +5180,13 @@ read_module (void) if (p->u.pointer == NULL) associate_integer_pointer (p, c); mio_pool_string (&comp_name); - gcc_assert (comp_name == c->name); + if (comp_name != c->name) + { + gfc_fatal_error ("Mismatch in components of derived type " + "%qs from %qs at %C: expecting %qs, " + "but got %qs", sym->name, sym->module, + c->name, comp_name); + } skip_list (1); /* component end. */ } mio_rparen (); /* component list closing. */