diff options
-rw-r--r-- | gcc/gimplify.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/gomp/pr103643.f90 | 19 |
2 files changed, 20 insertions, 1 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 92b4e75..d1b27d7 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -8123,7 +8123,7 @@ gimplify_omp_affinity (tree *list_p, gimple_seq *pre_p) if (error_operand_p (OMP_CLAUSE_DECL (c))) return; if (gimplify_expr (&OMP_CLAUSE_DECL (c), pre_p, NULL, - is_gimple_val, fb_rvalue) == GS_ERROR) + is_gimple_lvalue, fb_lvalue) == GS_ERROR) return; gimplify_and_add (OMP_CLAUSE_DECL (c), pre_p); } diff --git a/gcc/testsuite/gfortran.dg/gomp/pr103643.f90 b/gcc/testsuite/gfortran.dg/gomp/pr103643.f90 new file mode 100644 index 0000000..3b409f5 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/pr103643.f90 @@ -0,0 +1,19 @@ +! PR middle-end/103643 +! { dg-do compile } + +program test_task_affinity + implicit none + integer i + integer, allocatable :: A(:) + + allocate (A(10)) + + !$omp target + !$omp task affinity(A) + do i = 1, 10 + A(i) = 0 + end do + !$omp end task + !$omp end target + +end program test_task_affinity |