------- Comment #4 from dominiq at lps dot ens dot fr  2010-03-30 19:55 -------
Further reduced test that does not give an ICE, but several errors:

[macbook] f90/bug% cat pr43591_red_1.f90
module ward_lib

  implicit none

  type omega_procedures
     procedure(number_particles_out), nopass, pointer :: number_particles_out
=> NULL()
  end type omega_procedures

contains

  subroutine quantum_numbers2 ()
!    type(omega_procedures), intent(in) :: physical
    integer, dimension(physical%number_particles_out()) &
         :: table_flavor_states

  end subroutine quantum_numbers2

end module ward_lib
[macbook] f90/bug% gfc pr43591_red_1.f90
pr43591_red_1.f90:14.31:

    integer, dimension(physical%number_particles_out()) &
                               1
Error: Expected another dimension in array declaration at (1)
pr43591_red_1.f90:7.35:

     procedure(number_particles_out), nopass, pointer :: number_particles_out =
                                   1
Error: Symbol 'number_particles_out' at (1) has no IMPLICIT type
pr43591_red_1.f90:7.77:

   procedure(number_particles_out), nopass, pointer :: number_particles_out => 
                                                                           1  
Error: Interface 'number_particles_out' of procedure pointer component
'number_particles_out' at (1) must be explicit

If uncomment the commented line I get an ICE:

#0  fancy_abort (file=0x100974ce0 "../../p_work/gcc/fortran/expr.c", line=3604,
function=0x1009f4d80 "gfc_traverse_expr") at ../../p_work/gcc/diagnostic.c:762
#1  0x000000010002b86f in gfc_traverse_expr (expr=0x141815840, sym=0x0,
func=0x100026480 <expr_check_typed_help>, f=0) at
../../p_work/gcc/fortran/expr.c:3604
#2  0x000000010002c5e7 in gfc_expr_check_typed (e=0x141815840, ns=0x142078600,
strict=<value temporarily unavailable, due to optimizations>) at
../../p_work/gcc/fortran/expr.c:3767
#3  0x00000001000069f5 in gfc_match_array_spec (asp=0x100c8f140) at
../../p_work/gcc/fortran/array.c:310
#4  0x0000000100018bcf in match_attr_spec () at
../../p_work/gcc/fortran/decl.c:3044
#5  0x000000010001d137 in gfc_match_data_decl () at
../../p_work/gcc/fortran/decl.c:3730
#6  0x0000000100062f22 in match_word (str=<value temporarily unavailable, due
to optimizations>, subr=0x10001d0d0 <gfc_match_data_decl>,
old_locus=0x7fff5fbfd380) at ../../p_work/gcc/fortran/parse.c:65
#7  0x00000001000637ad in decode_statement () at
../../p_work/gcc/fortran/parse.c:283
#8  0x0000000100064dd5 in next_statement () at
../../p_work/gcc/fortran/parse.c:715
#9  0x000000010006613c in parse_spec (st=<value temporarily unavailable, due to
optimizations>) at ../../p_work/gcc/fortran/parse.c:2549
#10 0x000000010006838d in parse_progunit (st=ST_ARITHMETIC_IF) at
../../p_work/gcc/fortran/parse.c:3758
#11 0x0000000100068708 in parse_contained (module=1) at
../../p_work/gcc/fortran/parse.c:3698
#12 0x0000000100069c8a in gfc_parse_file () at
../../p_work/gcc/fortran/parse.c:3953
#13 0x00000001000a291c in gfc_be_parse_file (set_yydebug=<value temporarily
unavailable, due to optimizations>) at ../../p_work/gcc/fortran/f95-lang.c:239
#14 0x00000001006d6b5a in toplev_main (argc=2, argv=0x7fff5fbfd9e8) at
../../p_work/gcc/toplev.c:1053
#15 0x00000001000019e4 in start ()

Although gfortran should not give an ICE, I have doubts about the validity of
the code.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43591

Reply via email to