* omp-low.c (lower_rec_simd_input_clauses): Set TREE_THIS_NOTRAP on
ivar and lvar.
* gcc.dg/vect/vect-simd-5.c: New test.
From-SVN: r271824
+2019-05-31 Jakub Jelinek <jakub@redhat.com>
+
+ * omp-low.c (lower_rec_simd_input_clauses): Set TREE_THIS_NOTRAP on
+ ivar and lvar.
+
2019-05-31 Xiong Hu Luo <luoxhu@linux.ibm.com>
PR c/43673
NULL_TREE, NULL_TREE);
lvar = build4 (ARRAY_REF, TREE_TYPE (new_var), avar, sctx->lane,
NULL_TREE, NULL_TREE);
+ TREE_THIS_NOTRAP (ivar) = 1;
+ TREE_THIS_NOTRAP (lvar) = 1;
}
if (DECL_P (new_var))
{
+2019-05-31 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/vect/vect-simd-5.c: New test.
+
2019-05-31 Xiong Hu Luo <luoxhu@linux.ibm.com>
PR c/43673
--- /dev/null
+/* { dg-do compile } */
+/* { dg-additional-options "-fopenmp-simd" } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_condition } } } */
+
+int x;
+
+void
+foo (int *a)
+{
+ #pragma omp simd lastprivate (x)
+ for (int i = 0; i < 1024; ++i)
+ if (a[i])
+ x = i;
+}