[patch, fortran] Fix PR 78865, ICE on invalid

Thomas Koenig tkoenig@netcologne.de
Fri Mar 22 22:55:00 GMT 2019


Hello world,

the attached patch fixes a 7/8/9 regression.  The problem was twofold:
If a subroutine was called more than once from a different subroutine,
the call was only checked the first time.  Also, a type change in the
backend_decl initiated when there was already a declaration led to an
ICE.

The solution also has two parts: Make sure that a hard error is
delivered in this case, and make sure the check is done every time.

Regression-tested. OK for trunk and other affected branches?

Regards

	Thomas

2019-03-22  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/78865
	* interface.c (compare_actual_formal): Change errors about
	missing or extra to gfc_error_now to make sure they are issued.
	Change "spec" to "specifier" in message.
	* resolve.c (resolve_global_procedure): Also check for mismatching
	interface with global symbols if the namespace has already been
	resolved.

2019-03-22  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/78865
	* gfortran.dg/altreturn_10.f90: New test.
	* gfortran.dg/whole_file_3.f90: Change dg-warning to dg-error.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p4.diff
Type: text/x-patch
Size: 5170 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20190322/f00933d3/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: altreturn_10.f90
Type: text/x-fortran
Size: 394 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20190322/f00933d3/attachment-0001.bin>


More information about the Fortran mailing list