if (code->expr1 && (gfc_option.rtcheck & GFC_RTCHECK_BOUNDS)
&& code->expr1->rank == 0)
{
+ tree images2 = fold_convert (integer_type_node, images);
tree cond;
if (flag_coarray != GFC_FCOARRAY_LIB)
cond = fold_build2_loc (input_location, NE_EXPR, logical_type_node,
2, integer_zero_node,
build_int_cst (integer_type_node, -1));
cond = fold_build2_loc (input_location, GT_EXPR, logical_type_node,
- images, tmp);
+ images2, tmp);
cond2 = fold_build2_loc (input_location, LT_EXPR, logical_type_node,
images,
build_int_cst (TREE_TYPE (images), 1));
}
gfc_trans_runtime_check (true, false, cond, &se.pre,
&code->expr1->where, "Invalid image number "
- "%d in SYNC IMAGES",
- fold_convert (integer_type_node, images));
+ "%d in SYNC IMAGES", images2);
}
/* Per F2008, 8.5.1, a SYNC MEMORY is implied by calling the
--- /dev/null
+! { dg-do compile }
+! { dg-options "-fcoarray=lib -fcheck=all -fdefault-integer-8" }
+! PR fortran/71706 - ICE on using sync images with -fcheck=bounds
+
+program p
+ integer, volatile :: me = 1
+ sync images (me)
+ sync images (int (me, 2))
+ sync images (int (me, 8))
+end