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

            Bug ID: 95612
           Summary: [9/10/11 Regression] ICE in gfc_check_pointer_assign,
                    at fortran/expr.c:4274
           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 r7, gives expected error with r6 :


$ cat z1.f90
program p
   integer, pointer :: z(:) => shape(1)
end


$ cat z2.f90
program p
   integer, pointer :: z(:) => shape([1])
end


$ gfortran-6 -c z1.f90
z1.f90:2:36:

    integer, pointer :: z(:) => shape(1)
                                    1
Error: Pointer assignment target is neither TARGET nor POINTER at (1)


$ gfortran-11-20200607 -c z1.f90
f951: internal compiler error: in gfc_check_pointer_assign, at
fortran/expr.c:4274
0x65f27d gfc_check_pointer_assign(gfc_expr*, gfc_expr*, bool, bool)
        ../../gcc/fortran/expr.c:4274
0x65f48d gfc_check_assign_symbol(gfc_symbol*, gfc_component*, gfc_expr*)
        ../../gcc/fortran/expr.c:4438
0x63e1fe add_init_expr_to_sym
        ../../gcc/fortran/decl.c:1926
0x64817a variable_decl
        ../../gcc/fortran/decl.c:2990
0x64817a gfc_match_data_decl()
        ../../gcc/fortran/decl.c:6195
0x6ab513 match_word
        ../../gcc/fortran/parse.c:65
0x6ab513 decode_statement
        ../../gcc/fortran/parse.c:376
0x6acf5a next_free
        ../../gcc/fortran/parse.c:1279
0x6acf5a next_statement
        ../../gcc/fortran/parse.c:1511
0x6af304 parse_spec
        ../../gcc/fortran/parse.c:3738
0x6b137c parse_progunit
        ../../gcc/fortran/parse.c:5851
0x6b2a59 gfc_parse_file()
        ../../gcc/fortran/parse.c:6392
0x6feb3f gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:212

Reply via email to