https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78499

            Bug ID: 78499
           Summary: ICE in gfc_typename, at fortran/misc.c:158
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gerhard.steinmetz.fort...@t-online.de
  Target Milestone: ---

With invalid code down to at least 4.8 :
(configured with --enable-checking=yes)


$ cat z1.f90
program p
   type t
   end type
   class(t) :: x = 0
end


$ gfortran-7-20161120 z1.f90
z1.f90:4:16:

    class(t) :: x = 0
                1
Error: CLASS variable 'x' at (1) must be dummy, allocatable or pointer
f951: internal compiler error: Segmentation fault
0xc4265f crash_signal
        ../../gcc/toplev.c:333
0x6c239b gfc_typename(gfc_typespec*)
        ../../gcc/fortran/misc.c:158
0x6aa429 gfc_convert_type_warn(gfc_expr*, gfc_typespec*, int, int)
        ../../gcc/fortran/intrinsic.c:5020
0x695b49 gfc_check_assign_symbol(gfc_symbol*, gfc_component*, gfc_expr*)
        ../../gcc/fortran/expr.c:3878
0x71612b do_traverse_symtree
        ../../gcc/fortran/symbol.c:3994
0x6ff279 resolve_types
        ../../gcc/fortran/resolve.c:15963
0x6fac7c gfc_resolve(gfc_namespace*)
        ../../gcc/fortran/resolve.c:16058
0x6e520a resolve_all_program_units
        ../../gcc/fortran/parse.c:5977
0x6e520a gfc_parse_file()
        ../../gcc/fortran/parse.c:6224
0x729052 gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:202

Reply via email to