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

            Bug ID: 99819
           Summary: [9/10/11 Regression] ICE in gfc_defer_symbol_init, at
                    fortran/trans-decl.c:841
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gs...@t-online.de
  Target Milestone: ---

Affects versions down to r6 :


$ cat z1.f90
program p
   type t
   end type
contains
   function f(x, y)
      class(t) :: x(:)
      class(*) :: y(size(x))
   end
   function g(z)
      class(*) :: z(:)
      type(t) :: u(size(z))
   end
end


$ gfortran-5 -c z1.f90
$
$ gfortran-11-20210328 -c z1.f90
z1.f90:9:15:

    9 |    function g(z)
      |               1
internal compiler error: Segmentation fault
0xc09d4f crash_signal
        ../../gcc/toplev.c:327
0x75328b gfc_defer_symbol_init
        ../../gcc/fortran/trans-decl.c:841
0x756e5f gfc_defer_symbol_init
        ../../gcc/fortran/trans-decl.c:1229
0x756e5f gfc_build_dummy_array_decl
        ../../gcc/fortran/trans-decl.c:1209
0x75b443 gfc_get_symbol_decl(gfc_symbol*)
        ../../gcc/fortran/trans-decl.c:1697
0x76ac18 gfc_conv_variable
        ../../gcc/fortran/trans-expr.c:2913
0x766dda gfc_conv_expr(gfc_se*, gfc_expr*)
        ../../gcc/fortran/trans-expr.c:8938
0x769c40 gfc_conv_expr_lhs(gfc_se*, gfc_expr*)
        ../../gcc/fortran/trans-expr.c:8968
0x73cea8 gfc_conv_ss_descriptor
        ../../gcc/fortran/trans-array.c:3050
0x7473ac gfc_conv_expr_descriptor(gfc_se*, gfc_expr*)
        ../../gcc/fortran/trans-array.c:7367
0x77a102 gfc_conv_intrinsic_size
        ../../gcc/fortran/trans-intrinsic.c:8063
0x79186b gfc_conv_intrinsic_function(gfc_se*, gfc_expr*)
        ../../gcc/fortran/trans-intrinsic.c:10702
0x766dba gfc_conv_expr(gfc_se*, gfc_expr*)
        ../../gcc/fortran/trans-expr.c:8930
0x769c83 gfc_conv_expr_val(gfc_se*, gfc_expr*)
        ../../gcc/fortran/trans-expr.c:8983
0x769dd0 gfc_conv_expr_type(gfc_se*, gfc_expr*, tree_node*)
        ../../gcc/fortran/trans-expr.c:8997
0x742bbf gfc_trans_dummy_array_bias(gfc_symbol*, tree_node*,
gfc_wrapped_block*)
        ../../gcc/fortran/trans-array.c:6770
0x75d0dc gfc_trans_deferred_vars(gfc_symbol*, gfc_wrapped_block*)
        ../../gcc/fortran/trans-decl.c:4905
0x75f6d2 gfc_generate_function_code(gfc_namespace*)
        ../../gcc/fortran/trans-decl.c:6988
0x75f3e4 gfc_generate_contained_functions
        ../../gcc/fortran/trans-decl.c:5878
0x75f3e4 gfc_generate_function_code(gfc_namespace*)
        ../../gcc/fortran/trans-decl.c:6816

Reply via email to