From: Jakub Jelinek Date: Mon, 7 Jul 2008 15:26:35 +0000 (+0200) Subject: re PR middle-end/36726 (ICE in move_stmt_r, at tree-cfg.c:5699 with -fopenmp) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=77092cda69052ab6d1eca621173e76040266e5d9;p=gcc.git re PR middle-end/36726 (ICE in move_stmt_r, at tree-cfg.c:5699 with -fopenmp) PR middle-end/36726 * f95-lang.c (poplevel): Don't ever add subblocks to global_binding_level. * gfortran.dg/gomp/pr36726.f90: New test. From-SVN: r137572 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 7b641f077ba..0369a0f3483 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2008-07-07 Jakub Jelinek + + PR middle-end/36726 + * f95-lang.c (poplevel): Don't ever add subblocks to + global_binding_level. + 2008-07-02 Janus Weil Tobias Burnus Paul Thomas diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c index 794cc41a2d0..9dfb4233210 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 841f216c136..e8d7a599a0c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-07-07 Jakub Jelinek + + PR middle-end/36726 + * gfortran.dg/gomp/pr36726.f90: New test. + 2008-07-06 Richard Sandiford * 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 00000000000..99e170ad798 --- /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