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

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

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

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

With slightly reduced example from comment 2 :


$ cat z1.f90
program p
   type t
   end type
   type(t), allocatable :: x
   x = f()
contains
   function f() result(z)
      class(t), allocatable :: z
   end
end


$ gfortran-9-20181111 -c z1.f90
z1.f90:5:0:

    5 |    x = f()
      |
internal compiler error: in fold_convert_loc, at fold-const.c:2548
0x8a9bb3 fold_convert_loc(unsigned int, tree_node*, tree_node*)
        ../../gcc/fold-const.c:2548
0x6c0fba gfc_allocate_using_malloc(stmtblock_t*, tree_node*, tree_node*,
tree_node*)
        ../../gcc/fortran/trans.c:667
0x6fd9eb trans_class_assignment
        ../../gcc/fortran/trans-expr.c:10009
0x6fd9eb gfc_trans_assignment_1
        ../../gcc/fortran/trans-expr.c:10400
0x6bfdaf trans_code
        ../../gcc/fortran/trans.c:1822
0x6e7674 gfc_generate_function_code(gfc_namespace*)
        ../../gcc/fortran/trans-decl.c:6509
0x6744d6 translate_all_program_units
        ../../gcc/fortran/parse.c:6125
0x6744d6 gfc_parse_file()
        ../../gcc/fortran/parse.c:6328
0x6bc89f gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:204


Compiles with type(t) instead.

Reply via email to