A recent gfortran ICEs on the following code: module type_mod implicit none type x integer x end type x type y integer x end type y type z integer x end type z interface assignment(=) module procedure equals end interface assignment(=) interface operator(//) module procedure a_op_b, b_op_a end interface operator(//) contains subroutine equals(x,y) type(z), intent(in) :: y type(z), intent(out) :: x x%x = y%x end subroutine equals function a_op_b(a,b) type(x), intent(in) :: a type(y), intent(in) :: b type(z) a_op_b type(z) b_op_a entry b_op_a(b,a) a_op_b%x = a%x/b%x end function a_op_b end module type_mod program test use type_mod implicit none type(x) :: x1 = x(19) type(y) :: y1 = y(7) type(z) z1 z1 = x1//y1 write(*,*) 'x1//y1 = ',z1 z1 = y1//x1 write(*,*) 'y1//x1 = ',z1 end program test
Reduced testcase: module test implicit none interface operator(.foo.) module procedure b_op_a end interface operator(.foo.) contains function a_op_b() integer, intent(in) :: a, b integer :: a_op_b, b_op_a entry b_op_a(a,b) end function a_op_b end module test $ gfortran -c a.f90 a.f90:13.17: entry b_op_a(a,b) 1 Internal Error at (1): insert_bbt(): Duplicate key found!
Subject: Bug 31214 Author: pault Date: Sat Apr 7 21:18:17 2007 New Revision: 123642 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=123642 Log: 2007-04-07 Paul Thomas <pault@gcc.gnu.org> PR fortran/31214 * trans-decl.c (gfc_get_symbol_decl): Allow unreferenced use associated symbols. 2007-04-07 Paul Thomas <pault@gcc.gnu.org> PR fortran/31424 * gfortran.dg/unreferenced_use_assoc_1.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/unreferenced_use_assoc_1.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/trans-decl.c trunk/gcc/testsuite/ChangeLog
Fixed on trumk Paul
the original testcase fails (again/still?)
(In reply to comment #4) > the original testcase fails (again/still?) > Hmmm - it no longer ICEs but gives an error. I'll have a look. Paul
Subject: Bug number PR31214 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-08/msg00239.html
Subject: Bug 31214 Author: pault Date: Sat Aug 4 20:46:11 2007 New Revision: 127213 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=127213 Log: 2007-08-04 Paul Thomas <pault@gcc.gnu.org> PR fortran/31214 * symbol.c (get_unique_symtree): Moved from module.c. * module.c (get_unique_symtree): Moved to symbol.c. * decl.c (get_proc_name): Transfer the typespec from the local symbol to the module symbol, in the case that an entry is also a module procedure. Ensure the local symbol is cleaned up by pointing to it with a unique symtree. * dump_parse_tree (gfc_show_code_node): Add EXEC_ASSIGN_CALL. 2007-08-04 Paul Thomas <pault@gcc.gnu.org> PR fortran/31214 * gfortran.dg/entry_13.f90: New test. * gfortran.dg/entry_12.f90: Clean up .mod file. Added: trunk/gcc/testsuite/gfortran.dg/entry_13.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/decl.c trunk/gcc/fortran/dump-parse-tree.c trunk/gcc/fortran/gfortran.h trunk/gcc/fortran/module.c trunk/gcc/fortran/symbol.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gfortran.dg/entry_12.f90
Subject: Bug 31214 Author: pault Date: Sat Aug 4 20:58:11 2007 New Revision: 127214 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=127214 Log: 2007-08-04 Paul Thomas <pault@gcc.gnu.org> PR fortran/31214 * symbol.c (get_unique_symtree): Moved from module.c. * module.c (get_unique_symtree): Moved to symbol.c. * decl.c (get_proc_name): Transfer the typespec from the local symbol to the module symbol, in the case that an entry is also a module procedure. Ensure the local symbol is cleaned up by pointing to it with a unique symtree. * dump_parse_tree (gfc_show_code_node): Add EXEC_ASSIGN_CALL. 2007-08-04 Paul Thomas <pault@gcc.gnu.org> PR fortran/31214 * gfortran.dg/entry_13.f90: New test. * gfortran.dg/entry_12.f90: Clean up .mod file. Modified: trunk/gcc/fortran/ChangeLog
Fixed by Paul.