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

            Bug ID: 64674
           Summary: OOP Internal compiler error in associate with
                    allocated class
           Product: gcc
           Version: fortran-dev
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: antony at cosmologist dot info

On latest trunk

module X
  Type T
   integer :: map
  end Type T
contains

subroutine DoBug
   class(T), allocatable :: Cls(:,:)

   allocate(T::Cls(2, 2))
   associate(CL => Cls(1,2))
      CL%map = 2
   end associate

end subroutine
end module X

gives

testbug.f90:12:0:

       CL%map = 2
 1
internal compiler error: in gfc_conv_component_ref, at
fortran/trans-expr.c:1954
0x82e588e gfc_conv_component_ref
    ../../gcc-trunk/gcc/fortran/trans-expr.c:1954
0x82ed630 gfc_conv_variable
    ../../gcc-trunk/gcc/fortran/trans-expr.c:2211
0x82eaea0 gfc_conv_expr(gfc_se*, gfc_expr*)
    ../../gcc-trunk/gcc/fortran/trans-expr.c:6836
0x82f856d gfc_trans_assignment_1
    ../../gcc-trunk/gcc/fortran/trans-expr.c:8568
0x82f9a75 gfc_trans_assign(gfc_code*)
    ../../gcc-trunk/gcc/fortran/trans-expr.c:8765
0x82b836d trans_code
    ../../gcc-trunk/gcc/fortran/trans.c:1650
0x832b3f7 gfc_trans_block_construct(gfc_code*)
    ../../gcc-trunk/gcc/fortran/trans-stmt.c:1456
0x82b80c8 trans_code
    ../../gcc-trunk/gcc/fortran/trans.c:1755
0x82e1f55 gfc_generate_function_code(gfc_namespace*)
    ../../gcc-trunk/gcc/fortran/trans-decl.c:5843
0x82bc482 gfc_generate_module_code(gfc_namespace*)
    ../../gcc-trunk/gcc/fortran/trans.c:2021
0x82761ba translate_all_program_units
    ../../gcc-trunk/gcc/fortran/parse.c:5328
0x82761ba gfc_parse_file()
    ../../gcc-trunk/gcc/fortran/parse.c:5538
0x82b436b gfc_be_parse_file
    ../../gcc-trunk/gcc/fortran/f95-lang.c:228
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.

If you change class(T) to type(T) it compiles OK.

Reply via email to