https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103392
Bug ID: 103392
Summary: [9/10/11/12 Regression] ICE in simplify_bound, at
fortran/simplify.c:4273
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: ---
Started with r6 :
$ cat z1.f90
program p
integer, allocatable :: a(1:1)
integer :: b(1) = lbound(a)
integer :: c(1) = ubound(a)
end
$ gfortran-5 -c z1.f90
z1.f90:2:33:
integer, allocatable :: a(1:1)
1
Error: Allocatable array 'a' at (1) must have a deferred shape or assumed rank
$ gfortran-12-20211121 -c z1.f90
f951: internal compiler error: in simplify_bound, at fortran/simplify.c:4273
0x824e69 simplify_bound
../../gcc/fortran/simplify.c:4269
0x7ac9da do_simplify
../../gcc/fortran/intrinsic.c:4655
0x7b7a7a gfc_intrinsic_func_interface(gfc_expr*, int)
../../gcc/fortran/intrinsic.c:5034
0x80b71c resolve_unknown_f
../../gcc/fortran/resolve.c:2972
0x80b71c resolve_function
../../gcc/fortran/resolve.c:3329
0x80b71c gfc_resolve_expr(gfc_expr*)
../../gcc/fortran/resolve.c:7166
0x79cac4 gfc_reduce_init_expr(gfc_expr*)
../../gcc/fortran/expr.c:3130
0x79f990 gfc_match_init_expr(gfc_expr**)
../../gcc/fortran/expr.c:3178
0x789f44 variable_decl
../../gcc/fortran/decl.c:3004
0x789f44 gfc_match_data_decl()
../../gcc/fortran/decl.c:6297
0x7f3df3 match_word
../../gcc/fortran/parse.c:67
0x7f3df3 decode_statement
../../gcc/fortran/parse.c:378
0x7f583a next_free
../../gcc/fortran/parse.c:1397
0x7f583a next_statement
../../gcc/fortran/parse.c:1629
0x7f6f5b parse_spec
../../gcc/fortran/parse.c:4168
0x7fa2bc parse_progunit
../../gcc/fortran/parse.c:6179
0x7fb5a1 gfc_parse_file()
../../gcc/fortran/parse.c:6724
0x848a6f gfc_be_parse_file
../../gcc/fortran/f95-lang.c:216