https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93365

--- Comment #3 from markeggleston at gcc dot gnu.org ---
(In reply to markeggleston from comment #2)
> f951: internal compiler error: in gfc_match_varspec, at
> fortran/primary.c:2389
> 0x727097 gfc_match_varspec(gfc_expr*, int, bool, bool)
>       ../../gcc/gcc/fortran/primary.c:2389
> 0x728b35 gfc_match_rvalue(gfc_expr**)
>       ../../gcc/gcc/fortran/primary.c:3496
> 0x6ae0f4 match_data_constant
>       ../../gcc/gcc/fortran/decl.c:398
> 0x6ae356 top_val_list
>       ../../gcc/gcc/fortran/decl.c:499
> 0x6ae691 gfc_match_data()
>       ../../gcc/gcc/fortran/decl.c:712
> 0x7177b9 match_word_omp_simd
>       ../../gcc/gcc/fortran/parse.c:93
> 0x71cbc6 match_word
>       ../../gcc/gcc/fortran/parse.c:469
> 0x71cbc6 decode_statement
>       ../../gcc/gcc/fortran/parse.c:469
> 0x71d6d4 next_free
>       ../../gcc/gcc/fortran/parse.c:1279
> 0x71d6d4 next_statement
>       ../../gcc/gcc/fortran/parse.c:1511
> 0x71efcc parse_spec
>       ../../gcc/gcc/fortran/parse.c:3922
> 0x721728 parse_progunit
>       ../../gcc/gcc/fortran/parse.c:5851
> 0x722d54 gfc_parse_file()
>       ../../gcc/gcc/fortran/parse.c:6391
> 0x76e80f gfc_be_parse_file
>       ../../gcc/gcc/fortran/f95-lang.c:210
> 
> on master https://gcc.gnu.org/g:7491c17fe01d8cf116f645532d46120029b26408
> 
> This occurs for:
> 
>     program p
>       real, parameter :: a(0) = 0.5
>       write(\*,\*) a%kind
>     end
> 
> If the parameter attribute is removed or a non zero sized array is used, the
> ICE does not occur.
> 
> The ICE occurs in gfc_match_varspec (primary.c) a temporary gfc_ref
> structure has been created and has the type REF_INQUIRY. If the primary
> expression has been passed in is EXPR_CONSTANT the check is done. When the
> ICE occurs the type
> is EXPR_STRUCTURE, so the value of the REF_INQUIRY taken from u.i is used

my mistake EXPR_ARRAY not EXPR_STRUCTURE

> for the inquiry type instead of being 2 (INQUIRY_KIND) it is random
> e.g.73176720.

Reply via email to