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

            Bug ID: 102503
           Summary: ICE in gfc_conv_array_bound, at
                    fortran/trans-types.c:1224
           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: ---

Affects versions down to at least r5 :
(rejected with attribute allocatable/pointer)


$ cat z1.f90
subroutine s(x)
   class(*) :: x(..)[*]
end


$ cat z2.f90
program p
   type t
   end type
contains
   subroutine s(x)
      class(t) :: x(..)[*]
   end
end


$ gfortran-12-20210926 -c z1.f90 -fcoarray=lib
z1.f90:1:12:

    1 | subroutine s(x)
      |            1
internal compiler error: Segmentation fault
0xd400cf crash_signal
        ../../gcc/toplev.c:328
0x8cb54b gfc_conv_array_bound
        ../../gcc/fortran/trans-types.c:1224
0x8cb54b gfc_build_array_type
        ../../gcc/fortran/trans-types.c:1425
0x8cd5de gfc_get_derived_type(gfc_symbol*, int)
        ../../gcc/fortran/trans-types.c:2799
0x8cdd98 gfc_typenode_for_spec(gfc_typespec*, int)
        ../../gcc/fortran/trans-types.c:1178
0x8cdfee gfc_sym_type(gfc_symbol*)
        ../../gcc/fortran/trans-types.c:2289
0x8cc524 gfc_get_function_type(gfc_symbol*, gfc_actual_arglist*, char const*)
        ../../gcc/fortran/trans-types.c:3134
0x864ea4 build_function_decl
        ../../gcc/fortran/trans-decl.c:2406
0x86ab16 gfc_create_function_decl(gfc_namespace*, bool)
        ../../gcc/fortran/trans-decl.c:3105
0x871176 gfc_generate_function_code(gfc_namespace*)
        ../../gcc/fortran/trans-decl.c:6813
0x7f6646 translate_all_program_units
        ../../gcc/fortran/parse.c:6572
0x7f6646 gfc_parse_file()
        ../../gcc/fortran/parse.c:6841
0x842daf gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:216

Reply via email to