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

            Bug ID: 105168
           Summary: [9/10/11/12 Regression] ICE in
                    gfc_maybe_dereference_var, at
                    fortran/trans-expr.cc:2870
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gs...@t-online.de
  Target Milestone: ---

Started with r8, changed between 20190503 and 20190614 :
(follow-up of pr104430)


$ cat z1.f90
module m
   type t
      integer :: a
   end type
contains
   function f(x) result(z)
      class(t) :: x(:)
      type(t) :: z(size(x%a))
   end
end
program p
   use m
   class(t), allocatable :: y(:), z(:)
   z = f((y))
end


$ gfortran-7 -c z1.f90
$
$ gfortran-12-20220403 -c z1.f90
z1.f90:14:13:

   14 |    z = f((y))
      |             1
internal compiler error: Segmentation fault
0xcce34f crash_signal
        ../../gcc/toplev.cc:322
0x7d8cfd gfc_maybe_dereference_var(gfc_symbol*, tree_node*, bool, bool)
        ../../gcc/fortran/trans-expr.cc:2870
0x7e06fb gfc_conv_variable
        ../../gcc/fortran/trans-expr.cc:3065
0x7dc7da gfc_conv_expr(gfc_se*, gfc_expr*)
        ../../gcc/fortran/trans-expr.cc:9413
0x7df570 gfc_conv_expr_lhs(gfc_se*, gfc_expr*)
        ../../gcc/fortran/trans-expr.cc:9443
0x7afdf8 gfc_conv_ss_descriptor
        ../../gcc/fortran/trans-array.cc:3219
0x7ba85b gfc_conv_expr_descriptor(gfc_se*, gfc_expr*)
        ../../gcc/fortran/trans-array.cc:7501
0x7f10ff gfc_conv_intrinsic_size
        ../../gcc/fortran/trans-intrinsic.cc:7975
0x807f8b gfc_conv_intrinsic_function(gfc_se*, gfc_expr*)
        ../../gcc/fortran/trans-intrinsic.cc:10646
0x7dc7ba gfc_conv_expr(gfc_se*, gfc_expr*)
        ../../gcc/fortran/trans-expr.cc:9405
0x7deb8a gfc_apply_interface_mapping(gfc_interface_mapping*, gfc_se*,
gfc_expr*)
        ../../gcc/fortran/trans-expr.cc:4867
0x7aeb57 gfc_set_loop_bounds_from_array_spec(gfc_interface_mapping*, gfc_se*,
gfc_array_spec*)
        ../../gcc/fortran/trans-array.cc:1080
0x7ea037 gfc_conv_procedure_call(gfc_se*, gfc_symbol*, gfc_actual_arglist*,
gfc_expr*, vec<tree_node*, va_gc, vl_embed>*)
        ../../gcc/fortran/trans-expr.cc:7479
0x7eb93c gfc_trans_arrayfunc_assign
        ../../gcc/fortran/trans-expr.cc:10880
0x7ef614 gfc_trans_assignment(gfc_expr*, gfc_expr*, bool, bool, bool, bool)
        ../../gcc/fortran/trans-expr.cc:12045
0x7ab6c7 trans_code
        ../../gcc/fortran/trans.cc:1916
0x7d4b7e gfc_generate_function_code(gfc_namespace*)
        ../../gcc/fortran/trans-decl.cc:7654
0x75734e translate_all_program_units
        ../../gcc/fortran/parse.cc:6669
0x75734e gfc_parse_file()
        ../../gcc/fortran/parse.cc:6956
0x7a47df gfc_be_parse_file
        ../../gcc/fortran/f95-lang.cc:216

Reply via email to