Bug 85407 - Replace gcc_assert in module.c:read_module by more helpful diagnostics
Summary: Replace gcc_assert in module.c:read_module by more helpful diagnostics
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 9.0
: P4 normal
Target Milestone: 9.0
Assignee: kargls
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-15 19:15 UTC by Harald Anlauf
Modified: 2018-12-26 20:44 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2018-05-04 00:00:00


Attachments
Patch (354 bytes, patch)
2018-04-15 19:15 UTC, Harald Anlauf
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Anlauf 2018-04-15 19:15:23 UTC
Created attachment 43939 [details]
Patch

When reading inconsistent module files, an assert can be triggered in
read_module().  The attached patch replaces the assert by an error message
which may be more informative for the user.

See https://gcc.gnu.org/ml/fortran/2018-04/msg00023.html and context
for discussion and proposed Changelog.
Comment 1 Dominique d'Humieres 2018-05-04 11:51:48 UTC
The trunk is now at 9.0. The patch can be committed if accepted.
Comment 2 Harald Anlauf 2018-05-04 18:48:34 UTC
(In reply to Dominique d'Humieres from comment #1)
> The trunk is now at 9.0. The patch can be committed if accepted.

It was my understanding that Steve OK'd it and said that he'd commit,
but then did not.

I do not have commit rights.
Comment 3 kargls 2018-05-04 20:37:42 UTC
(In reply to Harald Anlauf from comment #2)
> (In reply to Dominique d'Humieres from comment #1)
> > The trunk is now at 9.0. The patch can be committed if accepted.
> 
> It was my understanding that Steve OK'd it and said that he'd commit,
> but then did not.
> 

Yeah, I'll get around to it when I have some free time.
Comment 4 kargls 2018-12-26 20:37:59 UTC
Author: kargl
Date: Wed Dec 26 20:37:28 2018
New Revision: 267422

URL: https://gcc.gnu.org/viewcvs?rev=267422&root=gcc&view=rev
Log:
2018-12-26  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/85407
	* module.c (read_module): Convert assert to fatal error to give 
	user a sensible error message.

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/module.c
Comment 5 kargls 2018-12-26 20:44:16 UTC
Fixed on trunk.  Harald, sorry about the long delay.  Perhaps, we should get you a commit bit. :)