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

            Bug ID: 114815
           Summary: internal compiler error: Segmentation fault -
                    Segmentation Fault - on creating type with len
                    parameter and dependent on it character array
           Product: gcc
           Version: 13.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dencraft29 at gmail dot com
  Target Milestone: ---

The following code lets gfortran crash: 

program lab_1_4
    type Student_Group(Size)
        integer, len :: Size
        character :: Genders(Size) = ""
    end type Student_Group

    type(Student_Group(22)) :: Group
end program lab_1_4

I have this crash on both my systems:
- GNU Fortran 12.2.0 on Debian 12 (bookworm) 6.1.0.-17-amd64 (virtual machine)
- GNU Fortran 13.2.0 on MacOS on Apple M1 Sonoma 14.4.1 (Homebrew GCC 13.2.0)

When I compile file with provided code, it consistently results in a
segmentation fault. It doesn’t matter what compilation flags I set, it
reproduced always.

Compiler stacktrace:
internal compiler error: Segmentation fault
0x1a22ff6 internal_error(char const*, ...)
        ???:0
0x7ad551 bool wi::lts_p<generic_wide_int<wi::extended_tree<576> >,
generic_wide_int<wi::extended_tree<576> >
>(generic_wide_int<wi::extended_tree<576> > const&,
generic_wide_int<wi::extended_tree<576> > const&)
        ???:0
0x7ace97 gfc_conv_array_initializer(tree_node*, gfc_expr*)
        ???:0
0x7d5cab gfc_conv_initializer(gfc_expr*, gfc_typespec*, tree_node*, bool, bool,
bool)
        ???:0
0x7d6280 gfc_conv_structure(gfc_se*, gfc_expr*, int)
        ???:0
0x7d5e47 gfc_conv_initializer(gfc_expr*, gfc_typespec*, tree_node*, bool, bool,
bool)
        ???:0
0x7bfdc8 gfc_generate_function_code(gfc_namespace*)
        ???:0
0x7388e6 gfc_parse_file()
        ???:0

Reply via email to