From 7f991c3616dc18e1082af9685308b96f8dc9d741 Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Tue, 17 Jan 2017 15:27:18 +0000 Subject: [PATCH] re PR c/79116 (ICE on cilkplus array notation with a _Cilk_for) PR c/79116 * array-notation-common.c (cilkplus_extract_an_triplets): Convert start type to integer_type. From-SVN: r244533 --- gcc/c-family/ChangeLog | 6 ++++++ gcc/c-family/array-notation-common.c | 4 +++- gcc/testsuite/gcc.dg/cilk-plus/pr79116.c | 9 +++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/cilk-plus/pr79116.c diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 6138f5276e1..8ea74d70536 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,9 @@ +2017-01-17 Aldy Hernandez + + PR c/79116 + * array-notation-common.c (cilkplus_extract_an_triplets): Convert + start type to integer_type. + 2017-01-16 Jakub Jelinek PR driver/49726 diff --git a/gcc/c-family/array-notation-common.c b/gcc/c-family/array-notation-common.c index 061c2030714..3b95332adad 100644 --- a/gcc/c-family/array-notation-common.c +++ b/gcc/c-family/array-notation-common.c @@ -628,7 +628,9 @@ cilkplus_extract_an_triplets (vec *list, size_t size, size_t rank, tree ii_tree = array_exprs[ii][jj]; (*node)[ii][jj].is_vector = true; (*node)[ii][jj].value = ARRAY_NOTATION_ARRAY (ii_tree); - (*node)[ii][jj].start = ARRAY_NOTATION_START (ii_tree); + (*node)[ii][jj].start + = fold_build1 (CONVERT_EXPR, integer_type_node, + ARRAY_NOTATION_START (ii_tree)); (*node)[ii][jj].length = fold_build1 (CONVERT_EXPR, integer_type_node, ARRAY_NOTATION_LENGTH (ii_tree)); diff --git a/gcc/testsuite/gcc.dg/cilk-plus/pr79116.c b/gcc/testsuite/gcc.dg/cilk-plus/pr79116.c new file mode 100644 index 00000000000..9206aaf3a1f --- /dev/null +++ b/gcc/testsuite/gcc.dg/cilk-plus/pr79116.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-fcilkplus" } */ + +int array[1024]; +void foo() +{ + _Cilk_for (int i = 0; i < 512; ++i) + array[:] = __sec_implicit_index(0); +} -- 2.30.2