https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104626
Bug ID: 104626
Summary: ICE in gfc_format_decoder, at fortran/error.cc:1071
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: [email protected]
Target Milestone: ---
Affects versions down to at least r5 :
$ cat z1.f90
program p
procedure(g), save :: f
procedure(g), save :: f
contains
subroutine g
end
end
$ cat z2.f90
program p
procedure(g), save :: f
contains
subroutine g
end
end
$ gfortran-12-20220220 -c z2.f90
z2.f90:2:26:
2 | procedure(g), save :: f
| 1
Error: PROCEDURE attribute conflicts with SAVE attribute in 'f' at (1)
$ gfortran-12-20220220 -c z1.f90
0xe7133f crash_signal
../../gcc/toplev.cc:322
0x72db98 gfc_format_decoder
../../gcc/fortran/error.cc:1071
0x1e7e570 pp_format(pretty_printer*, text_info*)
../../gcc/pretty-print.cc:1475
0x1e60195 diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
../../gcc/diagnostic.cc:1384
0x72da91 gfc_report_diagnostic
../../gcc/fortran/error.cc:883
0x72da91 gfc_warning
../../gcc/fortran/error.cc:916
0x72ebc1 gfc_notify_std(int, char const*, ...)
../../gcc/fortran/error.cc:1039
0x7ce70c gfc_add_save(symbol_attribute*, save_state, char const*, locus*)
../../gcc/fortran/symbol.cc:1314
0x7d0070 gfc_copy_attr(symbol_attribute*, symbol_attribute*, locus*)
../../gcc/fortran/symbol.cc:2093
0x721a5b match_procedure_decl
../../gcc/fortran/decl.cc:7064
0x721a5b gfc_match_procedure()
../../gcc/fortran/decl.cc:7365
0x787501 match_word
../../gcc/fortran/parse.cc:67
0x78d0a6 decode_statement
../../gcc/fortran/parse.cc:544
0x78d46a next_free
../../gcc/fortran/parse.cc:1397
0x78d46a next_statement
../../gcc/fortran/parse.cc:1629
0x78e9fb parse_spec
../../gcc/fortran/parse.cc:4168
0x791b4c parse_progunit
../../gcc/fortran/parse.cc:6192
0x793211 gfc_parse_file()
../../gcc/fortran/parse.cc:6737
0x7e154f gfc_be_parse_file
../../gcc/fortran/f95-lang.cc:216