From: Tobias Burnus Date: Thu, 29 Nov 2012 08:43:48 +0000 (+0100) Subject: re PR fortran/52161 (Internal compiler errors with -fcheck=bounds in coarray tests) X-Git-Tag: releases/gcc-4.8.0~1703 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=45d5889a070819486a619ca2a2664c186537cb40;p=thirdparty%2Fgcc.git re PR fortran/52161 (Internal compiler errors with -fcheck=bounds in coarray tests) 2012-11-28 Tobias Burnus PR fortran/52161 * trans-stmt.c (gfc_trans_sync): Fix bound checking for -fcoarray=lib. 2012-11-28 Tobias Burnus PR fortran/52161 * coarray/sync_3.f90: Extend test. From-SVN: r193924 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index cc996fe2d55c..9530339e6062 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2012-11-28 Tobias Burnus + + PR fortran/52161 + * trans-stmt.c (gfc_trans_sync): Fix bound checking + for -fcoarray=lib. + 2012-11-28 Tobias Burnus PR fortran/52161 diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c index 0c88c4aeda28..79dc27d903be 100644 --- a/gcc/fortran/trans-stmt.c +++ b/gcc/fortran/trans-stmt.c @@ -784,12 +784,12 @@ gfc_trans_sync (gfc_code *code, gfc_exec_op type) else { tree cond2; - cond = fold_build2_loc (input_location, GE_EXPR, boolean_type_node, + cond = fold_build2_loc (input_location, GT_EXPR, boolean_type_node, images, gfort_gvar_caf_num_images); cond2 = fold_build2_loc (input_location, LT_EXPR, boolean_type_node, images, build_int_cst (TREE_TYPE (images), 1)); - cond = fold_build2_loc (input_location, TRUTH_AND_EXPR, + cond = fold_build2_loc (input_location, TRUTH_OR_EXPR, boolean_type_node, cond, cond2); } gfc_trans_runtime_check (true, false, cond, &se.pre, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ad8880a34eec..d270ee0936ec 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-11-28 Tobias Burnus + + PR fortran/52161 + * coarray/sync_3.f90: Extend test. + 2012-11-29 Jakub Jelinek PR rtl-optimization/55512 diff --git a/gcc/testsuite/gfortran.dg/coarray/sync_3.f90 b/gcc/testsuite/gfortran.dg/coarray/sync_3.f90 index ef5aa6c229b7..205a78776780 100644 --- a/gcc/testsuite/gfortran.dg/coarray/sync_3.f90 +++ b/gcc/testsuite/gfortran.dg/coarray/sync_3.f90 @@ -1,5 +1,6 @@ ! { dg-do run } ! { dg-options "-fcheck=all" } +! { dg-shouldfail "Invalid image number -1 in SYNC IMAGES" } ! ! As sync_1, but with bounds checking enabled. ! PR fortran/52161 @@ -65,4 +66,10 @@ n = 5 sync images (*,errmsg=str,stat=n) if (n /= 0) call abort() +n = -1 +sync images ( num_images() ) +sync images (n) ! Invalid: "-1" + end + +! { dg-output "Fortran runtime error: Invalid image number -1 in SYNC IMAGES" }