Commit 1ce8fc63 by Jakub Jelinek Committed by Jakub Jelinek

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
parent 2099d446
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> 2019-05-31 Xiong Hu Luo <luoxhu@linux.ibm.com>
PR c/43673 PR c/43673
......
...@@ -3728,6 +3728,8 @@ lower_rec_simd_input_clauses (tree new_var, omp_context *ctx, ...@@ -3728,6 +3728,8 @@ lower_rec_simd_input_clauses (tree new_var, omp_context *ctx,
NULL_TREE, NULL_TREE); NULL_TREE, NULL_TREE);
lvar = build4 (ARRAY_REF, TREE_TYPE (new_var), avar, sctx->lane, lvar = build4 (ARRAY_REF, TREE_TYPE (new_var), avar, sctx->lane,
NULL_TREE, NULL_TREE); NULL_TREE, NULL_TREE);
TREE_THIS_NOTRAP (ivar) = 1;
TREE_THIS_NOTRAP (lvar) = 1;
} }
if (DECL_P (new_var)) 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> 2019-05-31 Xiong Hu Luo <luoxhu@linux.ibm.com>
PR c/43673 PR c/43673
......
/* { 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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment