• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqtwindows誰得cocoapythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

GCC with patches for OS216


Commit MetaInfo

Revision10b028c2813f683a8ebab7d36c9d0d05b49a710b (tree)
Zeit2020-07-03 03:29:58
AutorHarald Anlauf <anlauf@gmx....>
CommiterHarald Anlauf

Log Message

PR fortran/71706 - ICE on using sync images with -fcheck=bounds

The run-time checking code did not properly convert the kind of the
argument to SYNC IMAGES, leading to an error in verify_gimple. Fix that.

gcc/fortran/
PR fortran/71706
* trans-stmt.c (gfc_trans_sync): Do proper kind conversion in
bounds-checking code.

(cherry picked from commit e6cc67f6616c96f3e18a434e0c74ba2f3818cb6d)

Ändern Zusammenfassung

Diff

--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -1213,6 +1213,7 @@ gfc_trans_sync (gfc_code *code, gfc_exec_op type)
12131213 if (code->expr1 && (gfc_option.rtcheck & GFC_RTCHECK_BOUNDS)
12141214 && code->expr1->rank == 0)
12151215 {
1216+ tree images2 = fold_convert (integer_type_node, images);
12161217 tree cond;
12171218 if (flag_coarray != GFC_FCOARRAY_LIB)
12181219 cond = fold_build2_loc (input_location, NE_EXPR, logical_type_node,
@@ -1224,7 +1225,7 @@ gfc_trans_sync (gfc_code *code, gfc_exec_op type)
12241225 2, integer_zero_node,
12251226 build_int_cst (integer_type_node, -1));
12261227 cond = fold_build2_loc (input_location, GT_EXPR, logical_type_node,
1227- images, tmp);
1228+ images2, tmp);
12281229 cond2 = fold_build2_loc (input_location, LT_EXPR, logical_type_node,
12291230 images,
12301231 build_int_cst (TREE_TYPE (images), 1));
@@ -1233,8 +1234,7 @@ gfc_trans_sync (gfc_code *code, gfc_exec_op type)
12331234 }
12341235 gfc_trans_runtime_check (true, false, cond, &se.pre,
12351236 &code->expr1->where, "Invalid image number "
1236- "%d in SYNC IMAGES",
1237- fold_convert (integer_type_node, images));
1237+ "%d in SYNC IMAGES", images2);
12381238 }
12391239
12401240 /* Per F2008, 8.5.1, a SYNC MEMORY is implied by calling the
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr71706.f90
@@ -0,0 +1,10 @@
1+! { dg-do compile }
2+! { dg-options "-fcoarray=lib -fcheck=all -fdefault-integer-8" }
3+! PR fortran/71706 - ICE on using sync images with -fcheck=bounds
4+
5+program p
6+ integer, volatile :: me = 1
7+ sync images (me)
8+ sync images (int (me, 2))
9+ sync images (int (me, 8))
10+end