This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Bug Report 78935: ICE on allocating a derived type coarray with allocatable components


I just submitted the code below in Bug Report 78935.  Included in the cc list on this email is OpenCoarrays user Anuj Sharma whose application exposed this bug.  

A trunk build dated 20161224 reports an internal compiler error with an array allocation statement in the same scope as the allocation of a coarray with allocatable components. No ICE occurs when (1) the module and main program are in one file or (2) the USE statement is moved into the SUBROUTINE or (3) the order of the allocate statements is reversed or (4) when both allocations are moved into the main program.  Because this is a greatly reduced bug reproducer from an OpenCoarrays user, not all such workarounds are feasible.  For example, in the original application, the subroutine is a module subroutine so workaround (4) is not an option.

$ gfortran --version
GNU Fortran (GCC) 7.0.0 20161224 (experimental)…

$ cat declarations.f90 
module DECLARATIONS
    type EXCHANGE_BOUNDHI
        real,allocatable::NORMALS(:)
    end type 
    type(EXCHANGE_BOUNDHI),allocatable::IEXBOUNDHISI[:]
    real, allocatable :: x(:)
end module 

$ cat communications.f90 
    USE DECLARATIONS
contains
    SUBROUTINE EXHBOUNDHIGHER2()
        allocate(x(1))
        allocate(IEXBOUNDHISI[*])
    END SUBROUTINE 
END

$ gfortran -fcoarray=lib -c declarations.f90 communications.f90 
communications.f90:5:0:

         allocate(IEXBOUNDHISI[*])
 
internal compiler error: in gfc_conv_descriptor_token, at fortran/trans-array.c:305
0x6faa1d gfc_conv_descriptor_token(tree_node*)
	/home/rouson/Desktop/Builds/opencoarrays/prerequisites/downloads/trunk/gcc/fortran/trans-array.c:303
0x73ae88 gfc_trans_structure_assign(tree_node*, gfc_expr*, bool, bool)
	/home/rouson/Desktop/Builds/opencoarrays/prerequisites/downloads/trunk/gcc/fortran/trans-expr.c:7534
0x73bc32 gfc_conv_structure(gfc_se*, gfc_expr*, int)
	/home/rouson/Desktop/Builds/opencoarrays/prerequisites/downloads/trunk/gcc/fortran/trans-expr.c:7651
0x73425c gfc_conv_expr(gfc_se*, gfc_expr*)
	/home/rouson/Desktop/Builds/opencoarrays/prerequisites/downloads/trunk/gcc/fortran/trans-expr.c:7818
0x73db75 gfc_trans_assignment_1
	/home/rouson/Desktop/Builds/opencoarrays/prerequisites/downloads/trunk/gcc/fortran/trans-expr.c:9877
0x781b59 gfc_trans_allocate(gfc_code*)
	/home/rouson/Desktop/Builds/opencoarrays/prerequisites/downloads/trunk/gcc/fortran/trans-stmt.c:6293
0x6f3557 trans_code
	/home/rouson/Desktop/Builds/opencoarrays/prerequisites/downloads/trunk/gcc/fortran/trans.c:1966
0x7245f8 gfc_generate_function_code(gfc_namespace*)
	/home/rouson/Desktop/Builds/opencoarrays/prerequisites/downloads/trunk/gcc/fortran/trans-decl.c:6285
0x7242ec gfc_generate_contained_functions
	/home/rouson/Desktop/Builds/opencoarrays/prerequisites/downloads/trunk/gcc/fortran/trans-decl.c:5280
0x7242ec gfc_generate_function_code(gfc_namespace*)
	/home/rouson/Desktop/Builds/opencoarrays/prerequisites/downloads/trunk/gcc/fortran/trans-decl.c:6214
0x6abf76 translate_all_program_units
	/home/rouson/Desktop/Builds/opencoarrays/prerequisites/downloads/trunk/gcc/fortran/parse.c:6008
0x6abf76 gfc_parse_file()
	/home/rouson/Desktop/Builds/opencoarrays/prerequisites/downloads/trunk/gcc/fortran/parse.c:6208
0x6ef672 gfc_be_parse_file
	/home/rouson/Desktop/Builds/opencoarrays/prerequisites/downloads/trunk/gcc/fortran/f95-lang.c:202
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.


________________________________
Damian Rouson, Ph.D., P.E.
President, Sourcery Institute
http://www.sourceryinstitute.org
+1-510-600-2992 (mobile)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]