http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55272
Bug #: 55272 Summary: [4.8 Regression] ICE on passing coarray argument between files Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassig...@gcc.gnu.org ReportedBy: domi...@lps.ens.fr CC: bur...@gcc.gnu.org >From http://gcc.gnu.org/ml/fortran/2012-11/msg00021.html $ cat co_sum_module.f90 module co_sum_module implicit none contains subroutine co_sum(scalar) integer scalar[*] end subroutine end module $ cat league.f90 program main use co_sum_module implicit none integer score[*] call co_sum(score) end program $ gfortran -c -fcoarray=single co_sum_module.f90 $ gfortran -fcoarray=single league.f90 co_sum_module.o league.f90: In function 'MAIN__': league.f90:5:0: internal compiler error: Segmentation fault: 11 call co_sum(score) Revision 189780 (2012-07-23) is OK, revision 189986 (2012-07-30) gives the ICE. The backtrace at r193387 is #0 gfc_get_nodesc_array_type (etype=<value optimized out>, as=<value optimized out>, packed=<value optimized out>, restricted=<value optimized out>) at ../../_clean/gcc/fortran/trans-types.c:1574 #1 0x000000010011f778 in gfc_sym_type (sym=<value optimized out>) at ../../_clean/gcc/fortran/trans-types.c:2157 #2 0x000000010011e3a5 in gfc_get_function_type (sym=<value optimized out>) at ../../_clean/gcc/fortran/trans-types.c:2766 #3 0x00000001000e3bbe in gfc_get_extern_function_decl (sym=<value optimized out>) at ../../_clean/gcc/fortran/trans-decl.c:1750 #4 0x00000001000efbf2 in gfc_conv_procedure_call (se=<value optimized out>, sym=<value optimized out>, args=<value optimized out>, expr=<value optimized out>, append_args=<value optimized out>) at ../../_clean/gcc/fortran/trans-expr.c:2675 #5 0x0000000100111b20 in gfc_trans_call (code=<value optimized out>, dependency_check=<value optimized out>, mask=<value optimized out>, count1=<value optimized out>, invert=<value optimized out>) at ../../_clean/gcc/fortran/trans-stmt.c:407 #6 0x00000001000c85f0 in trans_code (code=0x141514fb0, cond=0x0) at ../../_clean/gcc/fortran/trans.c:1385 #7 0x00000001000e7004 in gfc_generate_function_code (ns=<value optimized out>) at ../../_clean/gcc/fortran/trans-decl.c:5349 #8 0x000000010008465f in gfc_parse_file () at ../../_clean/gcc/fortran/parse.c:4634 #9 0x00000001000c4376 in gfc_be_parse_file () at ../../_clean/gcc/fortran/f95-lang.c:191 #10 0x000000010066a509 in compile_file () at ../../_clean/gcc/toplev.c:544 #11 0x000000010066c369 in toplev_main (argc=4, argv=0x7fff5fbfd758) at ../../_clean/gcc/toplev.c:1864 #12 0x000000010000acb4 in start (pc=<value optimized out>, bases=0x0) at ../../../_clean/libgcc/config/unwind-dw2-fde-darwin.c:271 The ICE disappears if I revert revision 189881 on top of 193391. Note that the ICE can be reproduced with a single file compiled with -fcoarray=single -fno-whole-file.