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

            Bug ID: 102533
           Summary: ICE in gfc_set_backend_locus, at fortran/trans.c:1861
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gs...@t-online.de
  Target Milestone: ---

Running the generator from comment 1 will produce a number of files,
some of them are valid, some are invalid (see F2018 6.1.6).
An ICE occurs with char(k), k=0,9,10,12,13,32,33,59.
Affects versions down to at least r5.


$ cat z1.f90   # valid, this is file zb033.f90
end;&
!


$ gfortran-12-20210926 -c z1.f90
f951: Warning: Inconsistent internal state: No location in statement
f951: internal compiler error: Segmentation fault
0xd400cf crash_signal
        ../../gcc/toplev.c:328
0x849958 gfc_set_backend_locus(locus*)
        ../../gcc/fortran/trans.c:1861
0x864e70 build_function_decl
        ../../gcc/fortran/trans-decl.c:2398
0x86ab16 gfc_create_function_decl(gfc_namespace*, bool)
        ../../gcc/fortran/trans-decl.c:3105
0x871176 gfc_generate_function_code(gfc_namespace*)
        ../../gcc/fortran/trans-decl.c:6813
0x7f6646 translate_all_program_units
        ../../gcc/fortran/parse.c:6572
0x7f6646 gfc_parse_file()
        ../../gcc/fortran/parse.c:6841
0x842daf gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:216

Reply via email to