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

            Bug ID: 61952
           Summary: ICE allocattion of array of type of type
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: valeryweber at hotmail dot com

Dear All

the following code is ICEing with gfortran 4.9.1

v

>gfortran-4.9.1 -c  bug.F90 
bug.F90: In function ‘sm_multiply_a’:
bug.F90:29:0: internal compiler error: in gfc_conv_descriptor_data_set, at
fortran/trans-array.c:171
     ALLOCATE( matrices_a( n_push_tot + 1 ), matrices_b( n_push_tot + 1 ),
STAT=istat )
 ^
0x5ebe16 gfc_conv_descriptor_data_set
    ../../gcc-4.9.1/gcc/fortran/trans-array.c:171
0x5ebe16 gfc_conv_descriptor_data_set(stmtblock_t*, tree_node*, tree_node*)
    ../../gcc-4.9.1/gcc/fortran/trans-array.c:166
0x5f37cd structure_alloc_comps
    ../../gcc-4.9.1/gcc/fortran/trans-array.c:7785
0x5f2e8b structure_alloc_comps
    ../../gcc-4.9.1/gcc/fortran/trans-array.c:7978
0x5f311f structure_alloc_comps
    ../../gcc-4.9.1/gcc/fortran/trans-array.c:7646
0x5f4606 gfc_array_allocate(gfc_se*, gfc_expr*, tree_node*, tree_node*,
tree_node*, tree_node*, tree_node*, tree_node**, gfc_expr*, gfc_typespec*)
    ../../gcc-4.9.1/gcc/fortran/trans-array.c:5322
0x63c0b9 gfc_trans_allocate(gfc_code*)
    ../../gcc-4.9.1/gcc/fortran/trans-stmt.c:4952
0x5e89c7 trans_code
    ../../gcc-4.9.1/gcc/fortran/trans.c:1794
0x6082e2 gfc_generate_function_code(gfc_namespace*)
    ../../gcc-4.9.1/gcc/fortran/trans-decl.c:5653
0x5e9f01 gfc_generate_module_code(gfc_namespace*)
    ../../gcc-4.9.1/gcc/fortran/trans.c:1995
0x5a7b48 translate_all_program_units
    ../../gcc-4.9.1/gcc/fortran/parse.c:4940
0x5a7b48 gfc_parse_file()
    ../../gcc-4.9.1/gcc/fortran/parse.c:5150
0x5e4ca5 gfc_be_parse_file
    ../../gcc-4.9.1/gcc/fortran/f95-lang.c:212
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

>cat bug.F90
MODULE distribution_types
  ABSTRACT INTERFACE
     FUNCTION dist_map_blk_to_proc_func ( row, col, nrow_tot, ncol_tot,
proc_grid ) RESULT( reslt )
       INTEGER, INTENT( IN ) :: row, col, nrow_tot, ncol_tot
       INTEGER, DIMENSION( : ), INTENT( IN ) :: proc_grid
       INTEGER, DIMENSION( : ), ALLOCATABLE :: reslt
     END FUNCTION dist_map_blk_to_proc_func
  END INTERFACE
  TYPE, PUBLIC :: dist_type
     INTEGER, DIMENSION( : ), ALLOCATABLE :: task_coords
     PROCEDURE( dist_map_blk_to_proc_func ), NOPASS, POINTER :: map_blk_to_proc
=> NULL( )
  END TYPE dist_type
END MODULE distribution_types

MODULE sparse_matrix_types
  USE distribution_types,  ONLY : dist_type
  TYPE, PUBLIC :: sm_type
     TYPE( dist_type ) :: dist
  END TYPE sm_type
END MODULE sparse_matrix_types

MODULE sparse_matrix_multiply_a
  USE sparse_matrix_types,      ONLY : sm_type
CONTAINS
  SUBROUTINE sm_multiply_a (  )
    INTEGER :: n_push_tot, istat
    TYPE( sm_type ), DIMENSION( : ), ALLOCATABLE :: matrices_a, matrices_b
    n_push_tot =2
    ALLOCATE( matrices_a( n_push_tot + 1 ), matrices_b( n_push_tot + 1 ),
STAT=istat )
  END SUBROUTINE sm_multiply_a
END MODULE sparse_matrix_multiply_a

Reply via email to