https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106050
Bug ID: 106050
Summary: ICE in reject_statement, at fortran/parse.cc:2879
Product: gcc
Version: 13.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 r8 :
(out of order statement)
$ cat z1.f90
program p
stop
type t(k)
integer, kind :: k = 4
end type
end
$ cat z2.f90
program p
continue
type t(k)
integer, kind :: k = 4
end type
end
$ cat z3.f90
program p
a = 1
type t(k)
integer, kind :: k = 4
end type
end
$ cat z4.f90
program p
print *
type t(k)
integer, kind :: k = 4
end type
end
$ gfortran-13-20220619 -c z1.f90
z1.f90:3:12:
3 | type t(k)
| 1
Error: Unexpected derived type declaration statement at (1)
f951: internal compiler error: Segmentation fault
0xe845df crash_signal
../../gcc/toplev.cc:322
0x70b53a delete_root
../../gcc/fortran/bbt.cc:150
0x70b6fe gfc_delete_bbt(void*, void*, int (*)(void*, void*))
../../gcc/fortran/bbt.cc:197
0x7deca8 gfc_delete_symtree(gfc_symtree**, char const*)
../../gcc/fortran/symbol.cc:2963
0x7e053d gfc_restore_last_undo_checkpoint()
../../gcc/fortran/symbol.cc:3708
0x7950f7 reject_statement
../../gcc/fortran/parse.cc:2879
0x79f8aa parse_progunit
../../gcc/fortran/parse.cc:6257
0x7a0ea1 gfc_parse_file()
../../gcc/fortran/parse.cc:6755
0x7ef83f gfc_be_parse_file
../../gcc/fortran/f95-lang.cc:229