[Bug fortran/87991] New: ICE in gfc_constructor_append_expr, at fortran/constructor.c:135

gscfq@t-online.de gcc-bugzilla@gcc.gnu.org
Mon Nov 12 18:00:00 GMT 2018


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

            Bug ID: 87991
           Summary: ICE in gfc_constructor_append_expr, at
                    fortran/constructor.c:135
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

With (presumably) invalid code down to at least gfortran-5 :


$ cat z1.f90
program p
   type t
      character(:), pointer :: c
   end type
   type(t) :: x
   allocate (character(3) :: x%c)
   data x%c /'abc'/
end


$ cat z2.f90
module m
   type t
      character(:), pointer :: c
   end type
end
program p
   use m
   type(t) :: x
   allocate (character(3) :: x%c)
   data x%c /'abc'/
end


$ gfortran-9-20181111 -c z1.f90
f951: internal compiler error: Segmentation fault
0xb297bf crash_signal
        ../../gcc/toplev.c:325
0x5fea1b gfc_constructor_append_expr(splay_tree_s**, gfc_expr*, locus*)
        ../../gcc/fortran/constructor.c:135
0x60067c formalize_structure_cons
        ../../gcc/fortran/data.c:645
0x60067c formalize_init_expr
        ../../gcc/fortran/data.c:682
0x6aa142 do_traverse_symtree
        ../../gcc/fortran/symbol.c:4151
0x681833 resolve_types
        ../../gcc/fortran/resolve.c:16647
0x68656c gfc_resolve(gfc_namespace*)
        ../../gcc/fortran/resolve.c:16733
0x674337 resolve_all_program_units
        ../../gcc/fortran/parse.c:6064
0x674337 gfc_parse_file()
        ../../gcc/fortran/parse.c:6314
0x6bc89f gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:204


More information about the Gcc-bugs mailing list