re PR c/79116 (ICE on cilkplus array notation with a _Cilk_for)
authorAldy Hernandez <aldyh@redhat.com>
Tue, 17 Jan 2017 15:27:18 +0000 (15:27 +0000)
committerAldy Hernandez <aldyh@gcc.gnu.org>
Tue, 17 Jan 2017 15:27:18 +0000 (15:27 +0000)
PR c/79116
* array-notation-common.c (cilkplus_extract_an_triplets): Convert
start type to integer_type.

From-SVN: r244533

gcc/c-family/ChangeLog
gcc/c-family/array-notation-common.c
gcc/testsuite/gcc.dg/cilk-plus/pr79116.c [new file with mode: 0644]

index 6138f5276e17fd7c7fd5030994f5d737354a2066..8ea74d7053601a06b2e386cba62de27a3041d3ef 100644 (file)
@@ -1,3 +1,9 @@
+2017-01-17  Aldy Hernandez  <aldyh@redhat.com>
+
+       PR c/79116
+       * array-notation-common.c (cilkplus_extract_an_triplets): Convert
+       start type to integer_type.
+
 2017-01-16  Jakub Jelinek  <jakub@redhat.com>
 
        PR driver/49726
index 061c2030714b5a26e3b9551ebacbd08545ccdf32..3b95332adadb429868ea8886b075a1086954984c 100644 (file)
@@ -628,7 +628,9 @@ cilkplus_extract_an_triplets (vec<tree, va_gc> *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 (file)
index 0000000..9206aaf
--- /dev/null
@@ -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);
+}