[Bug fortran/92994] New: [10 Regression] ICE in gfc_get_class_from_expr, at fortran/trans-expr.c:486

gscfq@t-online.de gcc-bugzilla@gcc.gnu.org
Wed Dec 18 18:38:00 GMT 2019


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

            Bug ID: 92994
           Summary: [10 Regression] ICE in gfc_get_class_from_expr, at
                    fortran/trans-expr.c:486
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Followup of pr92780, changed between 20190922 and 20190929 :


$ cat z1.f90
function f() result(z)
   associate (y => f)
   end associate
end


$ cat z2.f90
program p
   type t
   end type
   type(t) :: z = t()
   associate (y => t)
   end associate
end


$ cat z3.f90
program p
   procedure() :: g
   associate (y => g)
   end associate
end


$ cat z4.f90
program p
   external :: g
   associate (y => g)
   end associate
end


$ cat z5.f90
subroutine s
   associate (y => s)
   end associate
end


$ gfortran-10-20190922 -c z2.f90      # accepts invalid
$
$ gfortran-10-20191215 -c z2.f90
z2.f90:2:0:

    2 |    type t
      |
internal compiler error: tree check: expected class 'expression', have
'declaration' (function_decl) in tree_operand_check, at tree.h:3771
0x5eebfa tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        ../../gcc/tree.c:9735
0x7473d9 expr_check(tree_node*, char const*, int, char const*)
        ../../gcc/tree.h:3442
0x7473d9 tree_operand_check(tree_node*, int, char const*, int, char const*)
        ../../gcc/tree.h:3771
0x7473d9 gfc_get_class_from_expr(tree_node*)
        ../../gcc/fortran/trans-expr.c:484
0x7a0c82 trans_associate_var
        ../../gcc/fortran/trans-stmt.c:2100
0x7a7519 gfc_trans_block_construct(gfc_code*)
        ../../gcc/fortran/trans-stmt.c:2283
0x70b137 trans_code
        ../../gcc/fortran/trans.c:1960
0x7424cd gfc_generate_function_code(gfc_namespace*)
        ../../gcc/fortran/trans-decl.c:6801
0x6bc426 translate_all_program_units
        ../../gcc/fortran/parse.c:6302
0x6bc426 gfc_parse_file()
        ../../gcc/fortran/parse.c:6541
0x70742f gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:210


More information about the Gcc-bugs mailing list