+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.
+
2015-11-16 Wilco Dijkstra <wdijkstr@arm.com>
* tree-ssa-math-opts.c (bswap_replace): Remove test
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);
+2016-11-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/78299
+ * gfortran.dg/gomp/pr78299.f90: New test.
+
2015-11-16 Wilco Dijkstra <wdijkstr@arm.com>
* gcc.dg/optimize-bswapdi-3.c: Remove xfail.
--- /dev/null
+! 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