https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64244
Bug ID: 64244 Summary: internal compiler error at class.c:236 when using non_overridable Product: gcc Version: 4.9.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: ondrej.certik at gmail dot com Created attachment 34235 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34235&action=edit Test program to trigger ICE This test file (also attached) produces ICE: $ cat test_non_overridable.f90 module m implicit none type :: A contains generic :: f => g procedure, non_overridable :: g end type contains subroutine g(this) class(A), intent(in) :: this end subroutine end module program test_non_overridable use m, only: A implicit none class(A), allocatable :: h call h%f() end program $ gfortran test_non_overridable.f90 f951: internal compiler error: in gfc_add_component_ref, at fortran/class.c:236 0x543cf7 gfc_add_component_ref(gfc_expr*, char const*) ../.././gcc/fortran/class.c:236 0x5b4c07 resolve_typebound_subroutine ../.././gcc/fortran/resolve.c:5942 0x5b4c07 gfc_resolve_code(gfc_code*, gfc_namespace*) ../.././gcc/fortran/resolve.c:9966 0x5b72aa resolve_codes ../.././gcc/fortran/resolve.c:14719 0x5b7392 gfc_resolve ../.././gcc/fortran/resolve.c:14747 0x5a2e5a resolve_all_program_units ../.././gcc/fortran/parse.c:4886 0x5a2e5a gfc_parse_file() ../.././gcc/fortran/parse.c:5135 0x5e00f5 gfc_be_parse_file ../.././gcc/fortran/f95-lang.c:212 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions. This affects gfortran 4.9.2, I also tried gfortran 4.7.2 which gives: $ gfortran test_non_overridable.f90 f951: internal compiler error: in gfc_add_component_ref, at fortran/class.c:209 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. When you remove the "non_overridable" keyword, it compiles. I wasn't able to simplify the test case further.