[Bug fortran/59298] ICE when initialising PARAMETER array of derived-type (containing an array) using array constructor
gscfq@t-online.de
gcc-bugzilla@gcc.gnu.org
Tue Jan 23 17:45:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59298
G. Steinmetz <gscfq@t-online.de> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |gscfq@t-online.de
--- Comment #9 from G. Steinmetz <gscfq@t-online.de> ---
Backtrace for slightly modified example from comment 4 :
$ cat z1.f90
program p
type t
integer :: m(1,1)
end type
type(t), parameter :: x(1) = [ t(789) ]
integer :: f(1,1)
f = (x(1)%m)
print *, f
end
$ gfortran-8-20180121 -std=f2008 -c z1.f90
f951: internal compiler error: Segmentation fault
0xb90cbf crash_signal
../../gcc/toplev.c:325
0x6a61e3 gfc_clear_shape(__mpz_struct (*) [1], int)
../../gcc/fortran/expr.c:412
0x6a61e3 gfc_free_shape(__mpz_struct (**) [1], int)
../../gcc/fortran/expr.c:422
0x6a630d free_expr0
../../gcc/fortran/expr.c:503
0x6a64c0 gfc_replace_expr(gfc_expr*, gfc_expr*)
../../gcc/fortran/expr.c:615
0x6a9b30 simplify_const_ref
../../gcc/fortran/expr.c:1722
0x6aa11d gfc_simplify_expr(gfc_expr*, int)
../../gcc/fortran/expr.c:2004
0x6aa21d simplify_parameter_variable
../../gcc/fortran/expr.c:1869
0x6aa106 gfc_simplify_expr(gfc_expr*, int)
../../gcc/fortran/expr.c:1976
0x6a9c52 simplify_intrinsic_op
../../gcc/fortran/expr.c:1105
0x6a9c52 gfc_simplify_expr(gfc_expr*, int)
../../gcc/fortran/expr.c:1965
0x70c3ef resolve_operator
../../gcc/fortran/resolve.c:4155
0x70c3ef gfc_resolve_expr(gfc_expr*)
../../gcc/fortran/resolve.c:6699
0x7125e0 gfc_resolve_code(gfc_code*, gfc_namespace*)
../../gcc/fortran/resolve.c:11065
0x71507a resolve_codes
../../gcc/fortran/resolve.c:16465
0x71517e gfc_resolve(gfc_namespace*)
../../gcc/fortran/resolve.c:16500
0x6feafa resolve_all_program_units
../../gcc/fortran/parse.c:6042
0x6feafa gfc_parse_file()
../../gcc/fortran/parse.c:6292
0x74520f gfc_be_parse_file
../../gcc/fortran/f95-lang.c:204
---
Compiles and works for me without parameter attribute :
$ cat z2.f90
program p
type t
integer :: m(1,1)
end type
type(t) :: x(1) = [ t(789) ]
integer :: f(1,1)
f = (x(1)%m)
print *, f
end
$ gfortran-8-20180121 -std=f2008 -static-libgfortran z2.f90
$ a.out
789
$
More information about the Gcc-bugs
mailing list