diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-08-19 17:30:33 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-08-19 17:30:33 +0200 |
commit | 1cad92845380a2175e70f5d6772d172f5c334201 (patch) | |
tree | c842c4c7d0803c5787383e84c95b89f6c746b55b | |
parent | fbdbd4b6d78bb9730107ebf5b2e7351f0d3dbf33 (diff) | |
download | gcc-1cad92845380a2175e70f5d6772d172f5c334201.zip gcc-1cad92845380a2175e70f5d6772d172f5c334201.tar.gz gcc-1cad92845380a2175e70f5d6772d172f5c334201.tar.bz2 |
re PR fortran/71014 (associate statement inside omp parallel do appears to disable default private attribute for inner loop indices)
PR fortran/71014
* resolve.c (gfc_resolve): For ns->construct_entities don't save, clear
and restore omp state around the resolving.
* testsuite/libgomp.fortran/pr71014.f90: New test.
From-SVN: r239620
-rw-r--r-- | gcc/fortran/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/fortran/resolve.c | 6 | ||||
-rw-r--r-- | libgomp/ChangeLog | 5 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.fortran/pr71014.f90 | 20 |
4 files changed, 33 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 11767cd..23386cc 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,9 @@ 2016-08-19 Jakub Jelinek <jakub@redhat.com> + PR fortran/71014 + * resolve.c (gfc_resolve): For ns->construct_entities don't save, clear + and restore omp state around the resolving. + PR fortran/69281 * trans-openmp.c (gfc_trans_omp_parallel, gfc_trans_omp_task, gfc_trans_omp_target): Wrap gfc_trans_omp_code result in an extra diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 7763f9c..b7036a8 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -15587,7 +15587,8 @@ gfc_resolve (gfc_namespace *ns) /* As gfc_resolve can be called during resolution of an OpenMP construct body, we should clear any state associated to it, so that say NS's DO loops are not interpreted as OpenMP loops. */ - gfc_omp_save_and_clear_state (&old_omp_state); + if (!ns->construct_entities) + gfc_omp_save_and_clear_state (&old_omp_state); resolve_types (ns); component_assignment_level = 0; @@ -15599,5 +15600,6 @@ gfc_resolve (gfc_namespace *ns) gfc_run_passes (ns); - gfc_omp_restore_state (&old_omp_state); + if (!ns->construct_entities) + gfc_omp_restore_state (&old_omp_state); } diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 5849aca..32b11ec 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,8 @@ +2016-08-19 Jakub Jelinek <jakub@redhat.com> + + PR fortran/71014 + * testsuite/libgomp.fortran/pr71014.f90: New test. + 2016-08-18 Chung-Lin Tang <cltang@codesourcery.com> PR middle-end/70895 diff --git a/libgomp/testsuite/libgomp.fortran/pr71014.f90 b/libgomp/testsuite/libgomp.fortran/pr71014.f90 new file mode 100644 index 0000000..6d0d6be --- /dev/null +++ b/libgomp/testsuite/libgomp.fortran/pr71014.f90 @@ -0,0 +1,20 @@ +! PR fortran/71014 +! { dg-do run } +! { dg-additional-options "-O0" } + +program pr71014 + implicit none + integer :: i, j + integer, parameter :: t = 100*101/2 + integer :: s(16) + s(:) = 0 +!$omp parallel do + do j = 1, 16 + associate (k => j) + do i = 1, 100 + s(j) = s(j) + i + end do + end associate + end do + if (any(s /= t)) call abort +end program pr71014 |