http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59024
Bug ID: 59024 Summary: ICE: after printing certain error messages, the compiler seg faults. Product: gcc Version: 4.8.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: kimwooyoung at gmail dot com This reproducer causes the compiler to seg fault. The compiler exits normally with the commented-out version. The reproducer is not a legal fortran program, but the compiler should not die with a seg fault. MODULE mtc USE ISO_C_BINDING PRIVATE PUBLIC :: tc, not_present1, & TYPE tc END TYPE tc INTERFACE tc MODULE PROCEDURE tc_ctor END INTERFACE tc CONTAINS ! TYPE(tc) FUNCTION tc_ctor() result(t) ! END FUNCTION tc_ctor FUNCTION tc_ctor() result(t) TYPE(tc) t END FUNCTION tc_ctor END MODULE mtc ======================= gfortran -c gf_reprod.F90 gf_reprod.F90:6.6: TYPE tc 1 Error: Syntax error in PUBLIC statement at (1) gf_reprod.F90:7.5: END TYPE tc 1 Error: Expecting END MODULE statement at (1) gf_reprod.F90:15.12: TYPE(tc) t 1 Error: Derived type 'tc' at (1) is being used before it is defined f951: internal compiler error: Segmentation fault 0x869cbf crash_signal ../../gcc-4.8.2/gcc/toplev.c:332 0x50b3fb show_locus ../../gcc-4.8.2/gcc/fortran/error.c:310 0x50bc90 show_loci ../../gcc-4.8.2/gcc/fortran/error.c:434 0x50bc90 error_print ../../gcc-4.8.2/gcc/fortran/error.c:666 0x50c778 gfc_error(char const*, ...) ../../gcc-4.8.2/gcc/fortran/error.c:961 0x5144f7 check_interface0 ../../gcc-4.8.2/gcc/fortran/interface.c:1477 0x516dd4 check_sym_interfaces ../../gcc-4.8.2/gcc/fortran/interface.c:1589 0x57e693 do_traverse_symtree ../../gcc-4.8.2/gcc/fortran/symbol.c:3575 0x516ebc gfc_check_interfaces(gfc_namespace*) ../../gcc-4.8.2/gcc/fortran/interface.c:1699 0x55d51e resolve_types ../../gcc-4.8.2/gcc/fortran/resolve.c:14989 0x55dda0 gfc_resolve ../../gcc-4.8.2/gcc/fortran/resolve.c:15073 0x552486 gfc_parse_file() ../../gcc-4.8.2/gcc/fortran/parse.c:4614 0x58e365 gfc_be_parse_file ../../gcc-4.8.2/gcc/fortran/f95-lang.c:189 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.