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

            Bug ID: 101564
           Summary: ICE in resolve_allocate_deallocate, at
                    fortran/resolve.c:8169
           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: ---

Since r9, backtrace when configured with --enable-checking=yes :


$ cat z1.f90
program p
   integer, allocatable :: x(:)
   integer :: stat
   allocate (x(2), stat=stat)
   deallocate (x, stat=stat%kind)
end


$ cat z2.f90
program p
   integer, allocatable :: x[:]
   integer :: stat
   allocate (x[*], stat=stat)
   deallocate (x, stat=stat%kind)
end


$ gfortran-12-20210718 -c z1.f90
z1.f90:5:32:

    5 |    deallocate (x, stat=stat%kind)
      |                                1
Error: Non-variable expression in variable definition context (STAT variable)
at (1)
f951: internal compiler error: Segmentation fault
0xe3985f crash_signal
        ../../gcc/toplev.c:328
0x7b3170 resolve_allocate_deallocate
        ../../gcc/fortran/resolve.c:8169
0x7b67b2 gfc_resolve_code(gfc_code*, gfc_namespace*)
        ../../gcc/fortran/resolve.c:12118
0x7b7317 resolve_codes
        ../../gcc/fortran/resolve.c:17427
0x7b73de gfc_resolve(gfc_namespace*)
        ../../gcc/fortran/resolve.c:17462
0x79f924 resolve_all_program_units
        ../../gcc/fortran/parse.c:6403
0x79f924 gfc_parse_file()
        ../../gcc/fortran/parse.c:6655
0x7ecf1f gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:216

Reply via email to