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

            Bug ID: 103138
           Summary: [12 Regression] ICE in gfc_simplify_cshift, at
                    fortran/simplify.c:2139
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: [email protected]
  Target Milestone: ---

Also changed between 20211031 and 20211107 :
(related to pr103137)


$ cat z1.f90
program p
   type t
   end type
   class(t), parameter :: a(2) = 2
   integer, parameter :: b(2) = cshift(a, 1)
end


$ gfortran-12-20211031 -c z1.f90
z1.f90:4:30:

    4 |    class(t), parameter :: a(2) = 2
      |                              1
Error: CLASS variable 'a' at (1) cannot have the PARAMETER attribute
z1.f90:4:32:

    4 |    class(t), parameter :: a(2) = 2
      |                                1
Error: Cannot convert INTEGER(4) to invalid class at (1)


$ gfortran-12-20211107 -c z1.f90
f951: internal compiler error: Segmentation fault
0xd4f7bf crash_signal
        ../../gcc/toplev.c:322
0x826574 gfc_simplify_cshift(gfc_expr*, gfc_expr*, gfc_expr*)
        ../../gcc/fortran/simplify.c:2139
0x7aa917 do_simplify
        ../../gcc/fortran/intrinsic.c:4672
0x7b52ea gfc_intrinsic_func_interface(gfc_expr*, int)
        ../../gcc/fortran/intrinsic.c:5051
0x808bec resolve_unknown_f
        ../../gcc/fortran/resolve.c:2972
0x808bec resolve_function
        ../../gcc/fortran/resolve.c:3329
0x808bec gfc_resolve_expr(gfc_expr*)
        ../../gcc/fortran/resolve.c:7166
0x79a754 gfc_reduce_init_expr(gfc_expr*)
        ../../gcc/fortran/expr.c:3130
0x79d620 gfc_match_init_expr(gfc_expr**)
        ../../gcc/fortran/expr.c:3178
0x787bf4 variable_decl
        ../../gcc/fortran/decl.c:3004
0x787bf4 gfc_match_data_decl()
        ../../gcc/fortran/decl.c:6297
0x7f12c3 match_word
        ../../gcc/fortran/parse.c:67
0x7f12c3 decode_statement
        ../../gcc/fortran/parse.c:378
0x7f2d0a next_free
        ../../gcc/fortran/parse.c:1388
0x7f2d0a next_statement
        ../../gcc/fortran/parse.c:1620
0x7f442b parse_spec
        ../../gcc/fortran/parse.c:4159
0x7f779c parse_progunit
        ../../gcc/fortran/parse.c:6170
0x7f8a71 gfc_parse_file()
        ../../gcc/fortran/parse.c:6715
0x845d3f gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:216

Reply via email to