------- Comment #2 from fxcoudert at gcc dot gnu dot org 2006-07-26 19:52
-------
gfortran 4.0 series is seriously broken and shouldn't be considered for
production use. Indeed, your testcase and variations work with the gfortran 4.2
branch, except for the following:
$ cat a.f90
integer, dimension(3), parameter :: a=(/1,2,3/)
integer, dimension(3), parameter :: b=(/a(:)/)
end
$ gfortran a.f90
a.f90:0: internal compiler error: Segmentation fault
which is an ICE. Removing the "(:)" makes it work. The backtrace for the ICE
is:
Program received signal SIGSEGV, Segmentation fault.
0xb7ee5473 in __gmpz_set () from /usr/lib/libgmp.so.3
(gdb) where
#0 0xb7ee5473 in __gmpz_set () from /usr/lib/libgmp.so.3
#1 0x08061c04 in simplify_const_ref (p=0x8729548)
at ../../../trunk/gcc/fortran/expr.c:1089
#2 0x0806260d in gfc_simplify_expr (p=0x8729548, type=1)
at ../../../trunk/gcc/fortran/expr.c:1499
#3 0x08062bb4 in simplify_parameter_variable (p=0x8729420, type=1)
at ../../../trunk/gcc/fortran/expr.c:1374
#4 0x080625ee in gfc_simplify_expr (p=0x8729420, type=1)
at ../../../trunk/gcc/fortran/expr.c:1470
#5 0x0804f4da in expand_constructor (c=0x8728c68)
at ../../../trunk/gcc/fortran/array.c:1375
#6 0x0804f66b in gfc_array_size (array=0x87293c8, result=0xbf919208)
at ../../../trunk/gcc/fortran/array.c:1968
#7 0x0808d4ff in expression_rank (e=0x87293c8)
at ../../../trunk/gcc/fortran/resolve.c:2798
#8 0x0808e7f8 in gfc_resolve_expr (e=0x87293c8)
at ../../../trunk/gcc/fortran/resolve.c:3026
#9 0x08062e16 in gfc_match_init_expr (result=0xbf919444)
at ../../../trunk/gcc/fortran/expr.c:1843
#10 0x0805b49a in variable_decl (elem=Variable "elem" is not available.
)
at ../../../trunk/gcc/fortran/decl.c:1268
#11 0x0805ba4a in gfc_match_data_decl ()
at ../../../trunk/gcc/fortran/decl.c:2316
#12 0x08084b0a in match_word (str=Variable "str" is not available.
) at ../../../trunk/gcc/fortran/parse.c:65
#13 0x080850ad in decode_statement () at ../../../trunk/gcc/fortran/parse.c:134
#14 0x08085a3e in next_statement () at ../../../trunk/gcc/fortran/parse.c:493
#15 0x080876ec in parse_spec (st=ST_DATA_DECL)
at ../../../trunk/gcc/fortran/parse.c:1870
#16 0x08087c09 in parse_progunit (st=Variable "st" is not available.
)
at ../../../trunk/gcc/fortran/parse.c:2870
#17 0x080880d1 in gfc_parse_file () at ../../../trunk/gcc/fortran/parse.c:3206
#18 0x080a91fd in gfc_be_parse_file (set_yydebug=0)
at ../../../trunk/gcc/fortran/f95-lang.c:303
#19 0x0839d14a in toplev_main (argc=13, argv=0xbf919744)
at ../../../trunk/gcc/toplev.c:999
#20 0x080dcd6f in main (argc=1, argv=0x1) at ../../../trunk/gcc/main.c:35
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |fxcoudert at gcc dot gnu dot
| |org
Severity|blocker |major
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
GCC build triplet|x86_64-redhat-linux |
GCC host triplet|x86_64-redhat-linux |
GCC target triplet|x86_64-redhat-linux |
Last reconfirmed|0000-00-00 00:00:00 |2006-07-26 19:52:36
date| |
Summary|Error during array |Error during array
|initialization with gfortran|initialization
Version|4.0.2 |4.2.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28496