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

            Bug ID: 70350
           Summary: ICE with -fcheck=all and array initialization
           Product: gcc
           Version: 5.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: valeryweber at hotmail dot com
  Target Milestone: ---

Hi All
The following code is producing an ICE with -fcheck=all.
v

gcc version 5.3.1 20160318 

cat tmp.f90 
MODULE system
  IMPLICIT NONE
  PRIVATE
  TYPE, PUBLIC :: paraw_t
     INTEGER, ALLOCATABLE, DIMENSION(:,:) :: nwa12
  END TYPE paraw_t
  TYPE(paraw_t), SAVE, PUBLIC :: paraw
END MODULE system

MODULE system_utils
  USE system,                          ONLY: paraw_t
  IMPLICIT NONE
  PRIVATE
CONTAINS
  SUBROUTINE alloc_paraw( paraw, max_nproc )
    TYPE(paraw_t), INTENT(INOUT)             :: paraw
    INTEGER, INTENT(IN)                      :: max_nproc
    INTEGER                                  :: ierr
    ALLOCATE( paraw%nwa12(0:max_nproc,2), &
         &    STAT=ierr )
    paraw%nwa12 = HUGE(0)
  END SUBROUTINE alloc_paraw
END MODULE system_utils

gfortran -fcheck=all tmp.f90 
tmp.f90:21:0:

     paraw%nwa12 = HUGE(0)
 1
internal compiler error: in wide_int_to_tree, at tree.c:1464
0x10c03da7 wide_int_to_tree(tree_node*,
generic_wide_int<wide_int_ref_storage<false> > const&)
        ../../src/gcc/tree.c:1464
0x10c036c3 build_int_cst(tree_node*, long)
        ../../src/gcc/tree.c:1272
0x1063d127 gfc_trans_assignment_1
        ../../src/gcc/fortran/trans-expr.c:9127
0x10621d37 trans_code
        ../../src/gcc/fortran/trans.c:1711
0x10621d37 gfc_trans_code(gfc_code*)
        ../../src/gcc/fortran/trans.c:2020
0x1062e1bb gfc_generate_function_code(gfc_namespace*)
        ../../src/gcc/fortran/trans-decl.c:5927
0x10e984cf gfc_generate_module_code(gfc_namespace*)
        ../../src/gcc/fortran/trans.c:2087
0x105da05b translate_all_program_units
        ../../src/gcc/fortran/parse.c:5393
0x105da05b gfc_parse_file()
        ../../src/gcc/fortran/parse.c:5603
0x10e92207 gfc_be_parse_file
        ../../src/gcc/fortran/f95-lang.c:229
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.

Reply via email to