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

            Bug ID: 99255
           Summary: ICE in gfc_dt_upper_string, at fortran/module.c:441
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gs...@t-online.de
  Target Milestone: ---

Affects versions down to at least r5,
with a missing attribute allocatable or pointer :
(follow-up of pr95980)


$ cat z1.f90
program p
   type t
      character(:), allocatable :: c
   end type
   class(t) :: x
   select type (y => x)
   end select
end


$ cat z2.f90
program p
   type t
      character(:), allocatable :: c(:)
   end type
   class(t) :: x
   select type (y => x)
   end select
end


$ gfortran-11-20210221 -c z1.f90
f951: internal compiler error: Segmentation fault
0xda031f crash_signal
        ../../gcc/toplev.c:327
0x6fecd0 gfc_dt_upper_string(char const*)
        ../../gcc/fortran/module.c:441
0x69e74a get_unique_type_string
        ../../gcc/fortran/class.c:490
0x69f191 get_unique_hashed_string
        ../../gcc/fortran/class.c:524
0x6a2678 gfc_build_class_symbol(gfc_typespec*, symbol_attribute*,
gfc_array_spec**)
        ../../gcc/fortran/class.c:672
0x6f9393 gfc_match_select_type()
        ../../gcc/fortran/match.c:6449
0x719244 match_word
        ../../gcc/fortran/parse.c:65
0x719244 decode_statement
        ../../gcc/fortran/parse.c:428
0x71aa7c next_free
        ../../gcc/fortran/parse.c:1316
0x71aa7c next_statement
        ../../gcc/fortran/parse.c:1548
0x71c0eb parse_spec
        ../../gcc/fortran/parse.c:3967
0x71eebc parse_progunit
        ../../gcc/fortran/parse.c:5896
0x7205b1 gfc_parse_file()
        ../../gcc/fortran/parse.c:6437
0x76dbcf gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:212

Reply via email to