diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/f95-lang.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/gomp/pr36726.f90 | 20 |
4 files changed, 35 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 7b641f0..0369a0f 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2008-07-07 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/36726 + * f95-lang.c (poplevel): Don't ever add subblocks to + global_binding_level. + 2008-07-02 Janus Weil <janus@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> Paul Thomas <pault@gcc.gnu.org> diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c index 794cc41a..9dfb423 100644 --- a/gcc/fortran/f95-lang.c +++ b/gcc/fortran/f95-lang.c @@ -435,6 +435,10 @@ poplevel (int keep, int reverse, int functionbody) DECL_INITIAL (current_function_decl) = block_node; BLOCK_VARS (block_node) = 0; } + else if (current_binding_level == global_binding_level) + /* When using gfc_start_block/gfc_finish_block from middle-end hooks, + don't add newly created BLOCKs as sublocks of global_binding_level. */ + ; else if (block_node) { current_binding_level->blocks diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 841f216..e8d7a59 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-07-07 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/36726 + * gfortran.dg/gomp/pr36726.f90: New test. + 2008-07-06 Richard Sandiford <rdsandiford@googlemail.com> * gcc.target/mips/gcc-have-sync-compare-and-swap-1.c: Expect the diff --git a/gcc/testsuite/gfortran.dg/gomp/pr36726.f90 b/gcc/testsuite/gfortran.dg/gomp/pr36726.f90 new file mode 100644 index 0000000..99e170a --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/pr36726.f90 @@ -0,0 +1,20 @@ +! PR middle-end/36726 +! { dg-do compile } +! { dg-options "-fopenmp" } + +subroutine foo + integer, allocatable :: vs(:) + !$omp parallel private (vs) + allocate (vs(10)) + vs = 2 + deallocate (vs) + !$omp end parallel +end subroutine foo +subroutine bar + integer, allocatable :: vs(:) + !$omp parallel private (vs) + allocate (vs(10)) + vs = 2 + deallocate (vs) + !$omp end parallel +end subroutine bar |