https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100196
Bug ID: 100196
Summary: [9/10/11/12 Regression] ICE in reduce_binary_ca, at
fortran/arith.c:1364
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 r8 (before 20180525) :
$ cat z1.f90
program p
real, parameter :: a(0) = 0
real :: b = 1 + [a]
end
$ cat z5.f90
program p
real, parameter :: a(0) = 0
real, parameter :: b(1) = 1 + [a]
end
$ gfortran-7 -c z5.f90
$
$ gfortran-7 -c z1.f90
z1.f90:3:12:
real :: b = 1 + [a]
1
Error: Incompatible ranks 0 and 1 in assignment at (1)
$ gfortran-11-20210418 -c z1.f90
f951: internal compiler error: Segmentation fault
0xc0b22f crash_signal
../../gcc/toplev.c:327
0x65083f reduce_binary_ca
../../gcc/fortran/arith.c:1364
0x6508d2 reduce_binary_ca
../../gcc/fortran/arith.c:1351
0x650b45 reduce_binary
../../gcc/fortran/arith.c:1434
0x650ddb eval_intrinsic
../../gcc/fortran/arith.c:1612
0x68cfba simplify_intrinsic_op
../../gcc/fortran/expr.c:1184
0x68cfba gfc_simplify_expr(gfc_expr*, int)
../../gcc/fortran/expr.c:2237
0x6f7589 resolve_operator
../../gcc/fortran/resolve.c:4431
0x6f3a6f gfc_resolve_expr(gfc_expr*)
../../gcc/fortran/resolve.c:7098
0x68c184 gfc_reduce_init_expr(gfc_expr*)
../../gcc/fortran/expr.c:3094
0x68f460 gfc_match_init_expr(gfc_expr**)
../../gcc/fortran/expr.c:3142
0x67aa44 variable_decl
../../gcc/fortran/decl.c:2892
0x67aa44 gfc_match_data_decl()
../../gcc/fortran/decl.c:6201
0x6de9c3 match_word
../../gcc/fortran/parse.c:65
0x6de9c3 decode_statement
../../gcc/fortran/parse.c:376
0x6e040c next_free
../../gcc/fortran/parse.c:1316
0x6e040c next_statement
../../gcc/fortran/parse.c:1548
0x6e1a7b parse_spec
../../gcc/fortran/parse.c:3967
0x6e484c parse_progunit
../../gcc/fortran/parse.c:5896
0x6e5f41 gfc_parse_file()
../../gcc/fortran/parse.c:6437