https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78686
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kargl at gcc dot gnu.org
--- Comment #3 from kargl at gcc dot gnu.org ---
(In reply to Gerhard Steinmetz from comment #0)
> With invalid code, down to at least 4.8 :
>
>
> $ cat z1.f90
> program p
> type t
> character :: c(1) = [t()]
> end type
> end
>
>
> $ gfortran-7-20161204 z1.f90
> f951: internal compiler error: in gfc_apply_init, at fortran/expr.c:4124
> 0x6911be gfc_apply_init(gfc_typespec*, symbol_attribute*, gfc_expr*)
> ../../gcc/fortran/expr.c:4124
> 0x684d98 build_struct
> ../../gcc/fortran/decl.c:1942
> 0x684d98 variable_decl
> ../../gcc/fortran/decl.c:2437
> 0x684d98 gfc_match_data_decl()
> ../../gcc/fortran/decl.c:4892
> 0x6dca79 match_word_omp_simd
> ../../gcc/fortran/parse.c:93
> 0x6e002e match_word
> ../../gcc/fortran/parse.c:377
> 0x6e002e decode_statement
> ../../gcc/fortran/parse.c:377
> 0x6e1e34 next_free
> ../../gcc/fortran/parse.c:1180
> 0x6e1e34 next_statement
> ../../gcc/fortran/parse.c:1413
> 0x6e337a parse_derived
> ../../gcc/fortran/parse.c:3233
> 0x6e337a parse_spec
> ../../gcc/fortran/parse.c:3773
> 0x6e5bb3 parse_progunit
> ../../gcc/fortran/parse.c:5615
> 0x6e71a4 gfc_parse_file()
> ../../gcc/fortran/parse.c:6124
> 0x72b182 gfc_be_parse_file
> ../../gcc/fortran/f95-lang.c:202
With up to date trunk (GNU Fortran (GCC) 8.0.0 20171109),
I see
% gfcx -c a.f90
a.f90:3:31:
character :: c(1) = [t()]
1
Error: Derived type 't' at (1) is being used before it is defined
I see the same error for the code in comment #2. I'll prepare
testcases and commit those later today or tomorrow.