https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87430
Bug ID: 87430 Summary: ICE in fortran/trans-types.c:1157 Product: gcc Version: 8.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: pascal22p at parois dot net Target Milestone: --- Hi, The following code result in a crash of the compiler. The code is non-conforming. module xlexical_mod contains subroutine lexical_preprocessing(image_text) implicit none character(len=*) :: image_text character(len=10), dimension(:), allocatable :: elements character(len=3) :: label integer serial !integer i allocate(elements(10)) do i=2, size(elements) associate(el => elements(i)) read(el(1:2), *) serial end associate end do end subroutine end module The crash is: ../crystals/crash.F90:5:0: subroutine lexical_preprocessing(image_text) internal compiler error: in gfc_typenode_for_spec, at fortran/trans-types.c:1157 0x58a9be gfc_typenode_for_spec(gfc_typespec*, int) ../../gcc/fortran/trans-types.c:1157 0x70b5fc gfc_sym_type(gfc_symbol*) ../../gcc/fortran/trans-types.c:2268 0x6b64ed gfc_get_symbol_decl(gfc_symbol*) ../../gcc/fortran/trans-decl.c:1728 0x6b94c7 generate_local_decl ../../gcc/fortran/trans-decl.c:5595 0x67f502 do_traverse_symtree ../../gcc/fortran/symbol.c:4165 0x6ba0ba generate_local_vars ../../gcc/fortran/trans-decl.c:5795 0x6ba0ba gfc_generate_function_code(gfc_namespace*) ../../gcc/fortran/trans-decl.c:6442 0x697819 gfc_generate_module_code(gfc_namespace*) ../../gcc/fortran/trans.c:2222 0x64aeeb translate_all_program_units ../../gcc/fortran/parse.c:6108 0x64aeeb gfc_parse_file() ../../gcc/fortran/parse.c:6324 0x69128f gfc_be_parse_file ../../gcc/fortran/f95-lang.c:204