diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-12-07 22:50:09 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-12-07 22:50:09 +0000 |
commit | 714667534d11910d59b31e963cbed1ad703e5eef (patch) | |
tree | ea9f9db4148d9792d58abb878ead28613b5c0e56 | |
parent | 1870adc2acb97bc9f0381317c99973d37e839105 (diff) | |
download | gcc-714667534d11910d59b31e963cbed1ad703e5eef.tar.gz |
Backported from mainline
2016-11-16 Jakub Jelinek <jakub@redhat.com>
PR fortran/78299
* omp-low.c (expand_omp_for_static_nochunk): Don't assert
that loop->header == body_bb if broken_loop.
* gfortran.dg/gomp/pr78299.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@243401 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/omp-low.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/gomp/pr78299.f90 | 55 |
4 files changed, 67 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fbdf31d90e9..1478a8366e6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,6 +1,12 @@ 2016-12-07 Jakub Jelinek <jakub@redhat.com> Backported from mainline + 2016-11-16 Jakub Jelinek <jakub@redhat.com> + + PR fortran/78299 + * omp-low.c (expand_omp_for_static_nochunk): Don't assert + that loop->header == body_bb if broken_loop. + 2016-11-07 Jakub Jelinek <jakub@redhat.com> PR target/77834 diff --git a/gcc/omp-low.c b/gcc/omp-low.c index 34f8dbcc6ee..7abba73039f 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -9603,7 +9603,7 @@ expand_omp_for_static_nochunk (struct omp_region *region, struct loop *loop = body_bb->loop_father; if (loop != entry_bb->loop_father) { - gcc_assert (loop->header == body_bb); + gcc_assert (broken_loop || loop->header == body_bb); gcc_assert (broken_loop || loop->latch == region->cont || single_pred (loop->latch) == region->cont); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 924052fe999..6281c1ffbaa 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,6 +1,11 @@ 2016-12-07 Jakub Jelinek <jakub@redhat.com> Backported from mainline + 2016-11-16 Jakub Jelinek <jakub@redhat.com> + + PR fortran/78299 + * gfortran.dg/gomp/pr78299.f90: New test. + 2016-11-07 Jakub Jelinek <jakub@redhat.com> PR target/78227 diff --git a/gcc/testsuite/gfortran.dg/gomp/pr78299.f90 b/gcc/testsuite/gfortran.dg/gomp/pr78299.f90 new file mode 100644 index 00000000000..d791e5a42e9 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/pr78299.f90 @@ -0,0 +1,55 @@ +! PR fortran/78299 +! { dg-do compile } +! { dg-additional-options "-fcheck=bounds" } + +program pr78299 + integer, parameter :: n = 8 + integer :: i, j + real :: x(n), y(n) + x = 1.0 + y = 2.0 + do j = 1, 9 + !$omp parallel workshare + !$omp parallel default(shared) + !$omp do + do i = 1, n + x(i) = x(i) * y(9) ! { dg-warning "is out of bounds" } + end do + !$omp end do + !$omp end parallel + !$omp end parallel workshare + end do + do j = 1, 9 + !$omp parallel workshare + !$omp parallel default(shared) + !$omp do schedule(static) + do i = 1, n + x(i) = x(i) * y(9) ! { dg-warning "is out of bounds" } + end do + !$omp end do + !$omp end parallel + !$omp end parallel workshare + end do + do j = 1, 9 + !$omp parallel workshare + !$omp parallel default(shared) + !$omp do schedule(static, 2) + do i = 1, n + x(i) = x(i) * y(9) ! { dg-warning "is out of bounds" } + end do + !$omp end do + !$omp end parallel + !$omp end parallel workshare + end do + do j = 1, 9 + !$omp parallel workshare + !$omp parallel default(shared) + !$omp do schedule(dynamic, 3) + do i = 1, n + x(i) = x(i) * y(9) ! { dg-warning "is out of bounds" } + end do + !$omp end do + !$omp end parallel + !$omp end parallel workshare + end do +end |