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

            Bug ID: 107899
           Summary: ICE in resolve_deallocate_expr, at
                    fortran/resolve.cc:7576
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gs...@t-online.de
  Target Milestone: ---

Affects versions down to at least r5 :
(target instead of allocatable)


$ cat z1.f90
program p
   type t
   end type
   class(t), target :: x[:]
   if (allocated(x)) deallocate (x)
end


$ cat z2.f90
program p
   type t
   end type
   class(t), target :: x[:]
   deallocate(x)
end


$ gfortran-13-20221127 -c z1.f90 -fcoarray=lib
z1.f90:4:27:

    4 |    class(t), target :: x[:]
      |                           1
Error: Coarray variable 'x' at (1) shall not have codimensions with deferred
shape
z1.f90:5:17:

    5 |    if (allocated(x)) deallocate (x)
      |                 1
Error: 'array' argument of 'allocated' intrinsic at (1) must be ALLOCATABLE
f951: internal compiler error: Segmentation fault
0xf36d0f crash_signal
        ../../gcc/toplev.cc:314
0x87a956 resolve_deallocate_expr
        ../../gcc/fortran/resolve.cc:7576
0x87a956 resolve_allocate_deallocate
        ../../gcc/fortran/resolve.cc:8461
0x87cfac gfc_resolve_code(gfc_code*, gfc_namespace*)
        ../../gcc/fortran/resolve.cc:12291
0x87b2ff gfc_resolve_blocks(gfc_code*, gfc_namespace*)
        ../../gcc/fortran/resolve.cc:10979
0x87b658 gfc_resolve_code(gfc_code*, gfc_namespace*)
        ../../gcc/fortran/resolve.cc:11971
0x87e407 resolve_codes
        ../../gcc/fortran/resolve.cc:17628
0x87e4ce gfc_resolve(gfc_namespace*)
        ../../gcc/fortran/resolve.cc:17663
0x866294 resolve_all_program_units
        ../../gcc/fortran/parse.cc:6631
0x866294 gfc_parse_file()
        ../../gcc/fortran/parse.cc:6887
0x8b4d3f gfc_be_parse_file
        ../../gcc/fortran/f95-lang.cc:229

Reply via email to