From: Jakub Jelinek Date: Fri, 31 May 2019 21:37:10 +0000 (+0200) Subject: omp-low.c (lower_rec_simd_input_clauses): Set TREE_THIS_NOTRAP on ivar and lvar. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1ce8fc63a4132b66ced527afd2c88b840ecbb0b9;p=gcc.git omp-low.c (lower_rec_simd_input_clauses): Set TREE_THIS_NOTRAP on ivar and lvar. * 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 29c8ecca5cf..3693ae605ca 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-05-31 Jakub Jelinek + + * omp-low.c (lower_rec_simd_input_clauses): Set TREE_THIS_NOTRAP on + ivar and lvar. + 2019-05-31 Xiong Hu Luo PR c/43673 diff --git a/gcc/omp-low.c b/gcc/omp-low.c index d200005dc28..1e47a36c534 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -3728,6 +3728,8 @@ lower_rec_simd_input_clauses (tree new_var, omp_context *ctx, 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)) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9dc9cbc3d32..fac9f2e2869 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2019-05-31 Jakub Jelinek + + * gcc.dg/vect/vect-simd-5.c: New test. + 2019-05-31 Xiong Hu Luo PR c/43673 diff --git a/gcc/testsuite/gcc.dg/vect/vect-simd-5.c b/gcc/testsuite/gcc.dg/vect/vect-simd-5.c new file mode 100644 index 00000000000..bacb2476e83 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-simd-5.c @@ -0,0 +1,14 @@ +/* { 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; +}