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

            Bug ID: 104096
           Summary: ICE with parameterized derived type (PDT)
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vivekrao4 at yahoo dot com
  Target Milestone: ---

gfortran-11 --version
GNU Fortran (Ubuntu 11.1.0-1ubuntu1~20.04) 11.1.0
<snip>

(base) /mnt/c/fortran/test$ cat pdt_sub.f90
module m 
implicit none
type :: t(n) 
  integer, len :: n = 0
  integer :: vec(n)
end type t
contains
subroutine disp(dt)
type(t(n=*)), intent(in) :: dt
print*,dt%vec
end subroutine disp
end module m
!
program main
use m, only: t, disp
implicit none
integer, parameter :: n = 3
type(t(n)) :: x
x%vec = [1,4,9]
print*,x%vec
call disp(x)
end program main

(base) /mnt/c/fortran/test$ gfortran-11 pdt_sub.f90
f951: internal compiler error: gfc_compare_array_spec(): Array spec clobbered
0x14f8018 gfc_internal_error(char const*, ...)
        ???:0
0x14a723b gfc_compare_array_spec(gfc_array_spec*, gfc_array_spec*)
        ???:0
0x14fb98a gfc_compare_derived_types(gfc_symbol*, gfc_symbol*)
        ???:0
0x15014b0 gfc_compare_actual_formal(gfc_actual_arglist**, gfc_formal_arglist*,
int, int, bool, locus*)
        ???:0
0x150283b gfc_procedure_use(gfc_symbol*, gfc_actual_arglist**, locus*)
        ???:0
0x1591c97 gfc_resolve_code(gfc_code*, gfc_namespace*)
        ???:0
0x1572ad1 gfc_parse_file()
        ???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-11/README.Bugs> for instructions.

Reply via email to