Compiling the tests gfortran.dg/coarray_2.f90 and gfortran.dg/coarray/sync_1.f90 with -fcheck=bounds gives an internal compiler error: #0 fold_convert_loc (loc=<value optimized out>, type=<value optimized out>, arg=<value optimized out>) at ../../work/gcc/fold-const.c:1856 #1 0x0000000100119ffc in gfc_trans_sync (code=<value optimized out>, type=<value optimized out>) at ../../work/gcc/fortran/trans-stmt.c:773 #2 0x00000001000b8828 in trans_code (code=<value optimized out>, cond=<value optimized out>) at ../../work/gcc/fortran/trans.c:1457 #3 0x00000001000e1d14 in gfc_generate_function_code (ns=<value optimized out>) at ../../work/gcc/fortran/trans-decl.c:5344 #4 0x000000010007501d in gfc_parse_file () at ../../work/gcc/fortran/parse.c:4455 #5 0x00000001000b38d6 in gfc_be_parse_file () at ../../work/gcc/fortran/f95-lang.c:250 #6 0x00000001007b8741 in toplev_main (argc=4, argv=0x7fff5fbfd7a0) at ../../work/gcc/toplev.c:557 #7 0x0000000100001a94 in start () or #0 fold_convert_loc (loc=<value optimized out>, type=<value optimized out>, arg=<value optimized out>) at ../../work/gcc/fold-const.c:1856 #1 0x0000000100119ffc in gfc_trans_sync (code=<value optimized out>, type=<value optimized out>) at ../../work/gcc/fortran/trans-stmt.c:773 #2 0x00000001000b8828 in trans_code (code=<value optimized out>, cond=<value optimized out>) at ../../work/gcc/fortran/trans.c:1457 #3 0x0000000100116554 in gfc_trans_if_1 (code=<value optimized out>) at ../../work/gcc/fortran/trans-stmt.c:963 #4 0x000000010011a8fb in gfc_trans_if (code=<value optimized out>) at ../../work/gcc/fortran/trans-stmt.c:994 #5 0x00000001000b8938 in trans_code (code=<value optimized out>, cond=<value optimized out>) at ../../work/gcc/fortran/trans.c:1416 #6 0x00000001000e1d14 in gfc_generate_function_code (ns=<value optimized out>) at ../../work/gcc/fortran/trans-decl.c:5344 #7 0x000000010007501d in gfc_parse_file () at ../../work/gcc/fortran/parse.c:4455 #8 0x00000001000b38d6 in gfc_be_parse_file () at ../../work/gcc/fortran/f95-lang.c:250 #9 0x00000001007b8741 in toplev_main (argc=4, argv=0x7fff5fbfd790) at ../../work/gcc/toplev.c:557 #10 0x0000000100001a94 in start ()
Still there at revision 193884.
Untested patch: --- a/gcc/fortran/trans-stmt.c +++ b/gcc/fortran/trans-stmt.c @@ -797,3 +797,3 @@ gfc_trans_sync (gfc_code *code, gfc_exec_op type) "%d in SYNC IMAGES", - fold_convert (integer_type_node, se.expr)); + fold_convert (integer_type_node, images)); }
Author: burnus Date: Wed Nov 28 21:42:17 2012 New Revision: 193908 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=193908 Log: 2012-11-28 Tobias Burnus <burnus@net-b.de> PR fortran/52161 * trans-stmt.c (gfc_trans_sync): Fix bound checking. 2012-11-28 Tobias Burnus <burnus@net-b.de> PR fortran/52161 * coarray/sync_3.f90: New. Added: trunk/gcc/testsuite/gfortran.dg/coarray/sync_3.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/trans-stmt.c trunk/gcc/testsuite/ChangeLog
FIXED (on the 4.8 trunk). Thanks for the report!
Author: burnus Date: Thu Nov 29 08:43:48 2012 New Revision: 193924 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=193924 Log: 2012-11-28 Tobias Burnus <burnus@net-b.de> PR fortran/52161 * trans-stmt.c (gfc_trans_sync): Fix bound checking for -fcoarray=lib. 2012-11-28 Tobias Burnus <burnus@net-b.de> PR fortran/52161 * coarray/sync_3.f90: Extend test. Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/trans-stmt.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gfortran.dg/coarray/sync_3.f90