Commit 7602cb87 by Jakub Jelinek Committed by Jakub Jelinek

re PR fortran/45597 (ICE: in gfc_trans_cycle, at fortran/trans-stmt.c:4320)

	PR fortran/45597
	* trans-openmp.c (gfc_trans_omp_do): Store exit/cycle labels on code
	instead of code->block.

	* gfortran.dg/gomp/pr45597.f90: New test.

From-SVN: r164005
parent 9c2934f4
2010-09-08 Jakub Jelinek <jakub@redhat.com> 2010-09-08 Jakub Jelinek <jakub@redhat.com>
PR fortran/45597
* trans-openmp.c (gfc_trans_omp_do): Store exit/cycle labels on code
instead of code->block.
PR fortran/45595 PR fortran/45595
* openmp.c (resolve_omp_do): Report not enough do loops for * openmp.c (resolve_omp_do): Report not enough do loops for
collapse even if block->next is NULL. collapse even if block->next is NULL.
......
...@@ -1386,8 +1386,8 @@ gfc_trans_omp_do (gfc_code *code, stmtblock_t *pblock, ...@@ -1386,8 +1386,8 @@ gfc_trans_omp_do (gfc_code *code, stmtblock_t *pblock,
/* Put these labels where they can be found later. */ /* Put these labels where they can be found later. */
code->block->cycle_label = cycle_label; code->cycle_label = cycle_label;
code->block->exit_label = NULL_TREE; code->exit_label = NULL_TREE;
/* Main loop body. */ /* Main loop body. */
tmp = gfc_trans_omp_code (code->block->next, true); tmp = gfc_trans_omp_code (code->block->next, true);
......
2010-09-08 Jakub Jelinek <jakub@redhat.com> 2010-09-08 Jakub Jelinek <jakub@redhat.com>
PR fortran/45597
* gfortran.dg/gomp/pr45597.f90: New test.
PR fortran/45595 PR fortran/45595
* gfortran.dg/gomp/pr45595.f90: New test. * gfortran.dg/gomp/pr45595.f90: New test.
......
! PR fortran/45597
! { dg-do compile }
! { dg-options "-fopenmp" }
subroutine foo(n)
integer :: i, n(6)
!$omp parallel do default(none) shared(n)
do i = 1, 6
if (n(i).gt.0) cycle
end do
end subroutine
subroutine bar(n)
integer :: i, j, k, n(6, 6, 6)
!$omp parallel do default(none) shared(n) collapse(3)
do i = 1, 6
do j = 1, 6
do k = 1, 6
if (n(i, j, k).gt.0) cycle
end do
end do
end do
end subroutine
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