Bug 85983 - ICE in check_dtio_interface1, at fortran/interface.c:4748
Summary: ICE in check_dtio_interface1, at fortran/interface.c:4748
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 9.0
: P4 normal
Target Milestone: ---
Assignee: Jerry DeLisle
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-29 18:42 UTC by G. Steinmetz
Modified: 2018-06-24 04:12 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description G. Steinmetz 2018-05-29 18:42:37 UTC
With incomplete or invalid dummy argument lists :


$ cat z1.f90
module m
   type t
   contains
      procedure :: s1
      procedure :: s2
      generic :: write(formatted) => s1
      generic :: write(formatted) => s2
   end type
contains
   subroutine s1 (dtv)
      class(t), intent(in) :: dtv
   end
   subroutine s2 (dtv, unit)
      class(t), intent(in) :: dtv
      integer, intent(in) :: unit
   end
end


$ cat z2.f90
module m
   type t
   contains
      procedure :: s1
      procedure :: s2
      generic :: write(formatted) => s1
      generic :: write(formatted) => s2
   end type
contains
   subroutine s1 (dtv, iomsg)
      class(t), intent(in) :: dtv
      character(*), intent(inout) :: iomsg
   end
   subroutine s2 (dtv, unit)
      class(t), intent(in) :: dtv
      integer, intent(in) :: unit
   end
end


$ gfortran-9-20180527 -c z1.f90
f951: internal compiler error: in check_dtio_interface1, at fortran/interface.c:4748
0x6b1478 check_dtio_interface1
        ../../gcc/fortran/interface.c:4748
0x6b8f05 gfc_check_dtio_interfaces(gfc_symbol*)
        ../../gcc/fortran/interface.c:4900
0x73595b do_traverse_symtree
        ../../gcc/fortran/symbol.c:4153
0x71c570 resolve_types
        ../../gcc/fortran/resolve.c:16513
0x71794c gfc_resolve(gfc_namespace*)
        ../../gcc/fortran/resolve.c:16586
0x701394 gfc_parse_file()
        ../../gcc/fortran/parse.c:6262
0x7480ef gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:204
Comment 1 Dominique d'Humieres 2018-05-31 13:15:46 UTC
Confirmed from 7.3.0 up to trunk (9.0).
Comment 2 Jerry DeLisle 2018-06-03 15:12:27 UTC
Removing the assert at interface.c:4748 seems to fix this, giving the following error:

z2.f03:14:16:

    subroutine s2 (dtv, unit)
                1
Error: Too few dummy arguments in DTIO procedure ‘s2’ at (1)
Comment 3 Jerry DeLisle 2018-06-24 04:09:56 UTC
Author: jvdelisle
Date: Sun Jun 24 04:09:20 2018
New Revision: 261994

URL: https://gcc.gnu.org/viewcvs?rev=261994&root=gcc&view=rev
Log:
2018-06-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/85983
	* interface.c (check_dtio_interface1): Delete assert.

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/interface.c
Comment 4 Jerry DeLisle 2018-06-24 04:12:55 UTC
Fixed on trunk.