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

G. Steinmetz <gs...@t-online.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gs...@t-online.de

--- Comment #5 from G. Steinmetz <gs...@t-online.de> ---

Reducing test case from comment 0 with "select type" results in za1/za2.
Problem is also relevant for "associate" construct, see za3.
And it holds for "allocatable" attribute too, see exemplary za6/za7.
Here type "t" contains two integers and one class(*).


$ cat za1.f90
module m
   type t
      integer :: a
      integer :: b
      class(*), pointer :: u(:)
   end type
end
program p
   use m
   type(t) :: z
   select type (y => z%u(1))
   end select
end


$ cat za2.f90
program p
   type t
      integer :: a
      integer :: b
      class(*), pointer :: u(:)
   end type
   type(t) :: z
   select type (y => z%u(1))
   end select
end


$ cat za3.f90
program p
   type t
      integer :: a
      integer :: b
      class(*), pointer :: u(:)
   end type
   type(t) :: z
   associate (y => z%u(1))
   end associate
end


$ cat za6.f90
program p
   type t
      integer :: a
      integer :: b
      class(*), allocatable :: u(:)
   end type
   type(t) :: z
   select type (y => z%u(1))
   end select
end


$ cat za7.f90
program p
   type t
      integer :: a
      integer :: b
      class(*), allocatable :: u(:)
   end type
   type(t) :: z
   associate (y => z%u(1))
   end associate
end


$ gfortran-9-20181111 -c za2.f90
za2.f90:1:0:

    1 | program p
      |
internal compiler error: in fold_convert_loc, at fold-const.c:2426
0x95f1b4 fold_convert_loc(unsigned int, tree_node*, tree_node*)
        ../../gcc/fold-const.c:2425
0x774aad trans_associate_var
        ../../gcc/fortran/trans-stmt.c:2027
0x77abc9 gfc_trans_block_construct(gfc_code*)
        ../../gcc/fortran/trans-stmt.c:2073
0x6e6817 trans_code
        ../../gcc/fortran/trans.c:1918
0x71be1d gfc_generate_function_code(gfc_namespace*)
        ../../gcc/fortran/trans-decl.c:6509
0x699c56 translate_all_program_units
        ../../gcc/fortran/parse.c:6125
0x699c56 gfc_parse_file()
        ../../gcc/fortran/parse.c:6328
0x6e2b7f gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:204

Reply via email to