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

            Bug ID: 78571
           Summary: ICE in create_character_initializer, at
                    fortran/data.c:191
           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 (with --enable-checking=yes).
A different facet; ICE does not depend on compile options, nor on locale.
Potentially related to pr70070.


$ cat z1.f90
program p
   type t
      character :: c
   end type
   character :: x = t('a')
   data x /'b'/
end


$ gfortran-7-20161127 z1.f90
z1.f90:5:19:

    character :: x = t('a')
                   1
Error: Can't convert TYPE(t) to CHARACTER(1) at (1)
f951: internal compiler error: Segmentation fault
0xc4532f crash_signal
        ../../gcc/toplev.c:333
0x678c32 create_character_initializer
        ../../gcc/fortran/data.c:191
0x678c32 gfc_assign_data_value(gfc_expr*, gfc_expr*, __mpz_struct*,
__mpz_struct (*) [1])
        ../../gcc/fortran/data.c:488
0x6f5779 check_data_variable
        ../../gcc/fortran/resolve.c:15032
0x6f5779 traverse_data_var
        ../../gcc/fortran/resolve.c:15161
0x700181 resolve_data
        ../../gcc/fortran/resolve.c:15216
0x700181 resolve_types
        ../../gcc/fortran/resolve.c:15970
0x6fbb0c gfc_resolve(gfc_namespace*)
        ../../gcc/fortran/resolve.c:16058
0x6e609a resolve_all_program_units
        ../../gcc/fortran/parse.c:5977
0x6e609a gfc_parse_file()
        ../../gcc/fortran/parse.c:6224
0x729ee2 gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:202

Reply via email to