https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64925
Bug ID: 64925 Summary: ICE with same names for dummy arg and internal procedure Product: gcc Version: 4.9.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: longb at cray dot com > cat test.f90 subroutine foo(nnn, aaa, bbb, ccc) implicit none integer :: nnn, aaa, bbb(nnn) integer :: i do i=1,nnn aaa = aaa + bbb(ccc(i)) end do contains integer function ccc(i) implicit none integer :: i ccc = i end function ccc end subroutine foo > gfortran -c test.f90 test.f90: In function 'foo': test.f90:1:0: internal compiler error: Segmentation fault subroutine foo(nnn, aaa, bbb, ccc) ^ 0x99c48f crash_signal ../../cray-gcc-4.9.2/gcc/toplev.c:337 0x687b03 create_function_arglist ../../cray-gcc-4.9.2/gcc/fortran/trans-decl.c:2142 0x68af6b gfc_create_function_decl(gfc_namespace*, bool) ../../cray-gcc-4.9.2/gcc/fortran/trans-decl.c:2585 0x68f689 gfc_generate_contained_functions ../../cray-gcc-4.9.2/gcc/fortran/trans-decl.c:4762 0x68f689 gfc_generate_function_code(gfc_namespace*) ../../cray-gcc-4.9.2/gcc/fortran/trans-decl.c:5589 0x62efe0 translate_all_program_units ../../cray-gcc-4.9.2/gcc/fortran/parse.c:4953 0x62efe0 gfc_parse_file() ../../cray-gcc-4.9.2/gcc/fortran/parse.c:5150 0x66c105 gfc_be_parse_file ../../cray-gcc-4.9.2/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. Expected: Error message saying that a dummy argument and an internal procedure cannot have the same name in a scoping unit. (Both are class 1 local identifiers in subclause 16.3.1.)