[Bug fortran/49278] ICE (segfault) when combining DATA with default initialization

gscfq@t-online.de gcc-bugzilla@gcc.gnu.org
Tue Oct 23 16:55:00 GMT 2018


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

--- Comment #18 from G. Steinmetz <gscfq@t-online.de> ---

Update and simplified a bit, ICEs down to at least version 5 :


$ cat z1.f90
module m
   type t
      sequence
      real :: a
      real :: b = 2.0
   end type
   type(t) :: z
   data z%a /3.0/
end


$ cat z2.f90
program p
   type t
      real :: a
      real :: b = 2.0
   end type
   type(t) :: z
   data z%a /3.0/
end


$ gfortran-9-20181021 -c z2.f90
z2.f90:1:0:

    1 | program p
      |
internal compiler error: Segmentation fault
0xb1c86f crash_signal
        ../../gcc/toplev.c:325
0x6ec0cd gfc_conv_structure(gfc_se*, gfc_expr*, int)
        ../../gcc/fortran/trans-expr.c:7865
0x6fca91 gfc_conv_initializer(gfc_expr*, gfc_typespec*, tree_node*, bool, bool,
bool)
        ../../gcc/fortran/trans-expr.c:7027
0x6e1647 gfc_get_symbol_decl(gfc_symbol*)
        ../../gcc/fortran/trans-decl.c:1824
0x6e3ec7 generate_local_decl
        ../../gcc/fortran/trans-decl.c:5596
0x6a80f2 do_traverse_symtree
        ../../gcc/fortran/symbol.c:4151
0x6e4fe4 generate_local_vars
        ../../gcc/fortran/trans-decl.c:5796
0x6e4fe4 gfc_generate_function_code(gfc_namespace*)
        ../../gcc/fortran/trans-decl.c:6440
0x673426 translate_all_program_units
        ../../gcc/fortran/parse.c:6125
0x673426 gfc_parse_file()
        ../../gcc/fortran/parse.c:6328
0x6ba3ff gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:204


More information about the Gcc-bugs mailing list