Commit 885b8230 by Thomas Koenig

frontend-passes.c (do_subscript): Don't do anything if inside an associate list.

2017-09-26  Thomas Koenig  <tkoenig@gcc.gnu.org>

	* frontend-passes.c (do_subscript): Don't do anything
	if inside an associate list.

2017-09-26  Thomas Koenig  <tkoenig@gcc.gnu.org>

	* gfortran.dg/gomp/associate1.f90: Remove unnecessary
	warning from associate construct and do loop.

From-SVN: r253211
parent 6c1f23ff
......@@ -2484,6 +2484,10 @@ do_subscript (gfc_expr **e)
if (v->expr_type == EXPR_CONSTANT)
return 0;
/* Wrong warnings will be generated in an associate list. */
if (in_assoc_list)
return 0;
for (ref = v->ref; ref; ref = ref->next)
{
if (ref->type == REF_ARRAY && ref->u.ar.type == AR_ELEMENT)
......
......@@ -14,7 +14,7 @@ program associate1
type(dt) :: b(3)
i = 1
j = 2
associate(k => v, l => a(i, j), m => a(i, :)) ! { dg-warning "out of bounds" }
associate(k => v, l => a(i, j), m => a(i, :))
associate(n => b(j)%c(:, :)%i, o => a, p => b)
!$omp parallel shared (l) ! { dg-error "ASSOCIATE name" }
!$omp end parallel
......@@ -75,7 +75,7 @@ program associate1
end do
k = 1
!$omp simd linear (k : 2) ! { dg-error "ASSOCIATE name" }
do i = 1, 10 ! { dg-warning "out of bounds" }
do i = 1, 10
k = k + 2
end do
end associate
......
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