diff options
author | Thomas Koenig <tkoenig@gcc.gnu.org> | 2017-09-26 18:32:16 +0000 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2017-09-26 18:32:16 +0000 |
commit | 885b8230a1f49f57720582b6bc811868e7acc418 (patch) | |
tree | e5690293ec6d8c3458d0076d2e948e90f23cdb10 | |
parent | 6c1f23fff1c23c17d9a6599e0855743474ff9f57 (diff) | |
download | gcc-885b8230a1f49f57720582b6bc811868e7acc418.zip gcc-885b8230a1f49f57720582b6bc811868e7acc418.tar.gz gcc-885b8230a1f49f57720582b6bc811868e7acc418.tar.bz2 |
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
-rw-r--r-- | gcc/fortran/frontend-passes.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/gomp/associate1.f90 | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/gcc/fortran/frontend-passes.c b/gcc/fortran/frontend-passes.c index 93f2c0f..ae4fba6 100644 --- a/gcc/fortran/frontend-passes.c +++ b/gcc/fortran/frontend-passes.c @@ -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) diff --git a/gcc/testsuite/gfortran.dg/gomp/associate1.f90 b/gcc/testsuite/gfortran.dg/gomp/associate1.f90 index 5412301..abc5ae9 100644 --- a/gcc/testsuite/gfortran.dg/gomp/associate1.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/associate1.f90 @@ -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 |