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

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

This changed between 20190922 and 20190929 :


$ cat z1.f90
program p
   if (f() /= 1) stop
   associate (y => f)
   end associate
contains
   integer function f()
      f = 1
   end
end


$ cat z2.f90
program p
   interface g
      procedure s
   end interface
   associate (y => g)
   end associate
contains
   subroutine s
   end
end


$ gfortran-10-20190922 -c z1.f90
$
$ gfortran-10-20200119 -c z1.f90
z1.f90:3:0:

    3 |    associate (y => f)
      |
internal compiler error: tree check: expected class 'expression', have
'declaration' (function_decl) in tree_operand_check, at tree.h:3776
0x611182 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        ../../gcc/tree.c:9735
0x76b189 expr_check(tree_node*, char const*, int, char const*)
        ../../gcc/tree.h:3447
0x76b189 tree_operand_check(tree_node*, int, char const*, int, char const*)
        ../../gcc/tree.h:3776
0x76b189 gfc_get_class_from_expr(tree_node*)
        ../../gcc/fortran/trans-expr.c:484
0x7c6ca2 trans_associate_var
        ../../gcc/fortran/trans-stmt.c:2100
0x7cd539 gfc_trans_block_construct(gfc_code*)
        ../../gcc/fortran/trans-stmt.c:2283
0x72f3f7 trans_code
        ../../gcc/fortran/trans.c:1960
0x76678d gfc_generate_function_code(gfc_namespace*)
        ../../gcc/fortran/trans-decl.c:6823
0x6e0546 translate_all_program_units
        ../../gcc/fortran/parse.c:6302
0x6e0546 gfc_parse_file()
        ../../gcc/fortran/parse.c:6541
0x72b6ef gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:210

Reply via email to