From c46df3b1575310324704ea842a5721501907ece7 Mon Sep 17 00:00:00 2001 From: jakub Date: Mon, 19 Apr 2010 21:50:16 +0000 Subject: PR middle-end/43337 * tree-nested.c (convert_nonlocal_omp_clauses): OMP_CLAUSE_PRIVATE with non-local decl doesn't need chain. * gfortran.dg/gomp/pr43337.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158527 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 4 ++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/gomp/pr43337.f90 | 30 ++++++++++++++++++++++++++++++ gcc/tree-nested.c | 5 +++-- 4 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gfortran.dg/gomp/pr43337.f90 diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dafcc6c6d3c..e16fa0c2009 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -3,6 +3,10 @@ * dwarf2out.c (lower_bound_default): For DW_LANG_Python return 0 for -gdwarf-4. + PR middle-end/43337 + * tree-nested.c (convert_nonlocal_omp_clauses): OMP_CLAUSE_PRIVATE + with non-local decl doesn't need chain. + 2010-04-19 Vladimir Makarov * ira-color.c (allocno_reload_assign): Avoid accumulating diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c553fe03291..d29867544e4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-04-19 Jakub Jelinek + + PR middle-end/43337 + * gfortran.dg/gomp/pr43337.f90: New test. + 2010-04-19 Richard Guenther PR tree-optimization/43796 diff --git a/gcc/testsuite/gfortran.dg/gomp/pr43337.f90 b/gcc/testsuite/gfortran.dg/gomp/pr43337.f90 new file mode 100644 index 00000000000..f07ccb441be --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/pr43337.f90 @@ -0,0 +1,30 @@ +! PR middle-end/43337 +! { dg-do compile } +! { dg-options "-fopenmp -O2 -g" } + +subroutine pr43337 + integer :: a, b(10) + call foo (b) + call bar (b) +contains + subroutine foo (b) + integer :: b(10) +!$omp parallel if (.false.) +!$omp task if (.false.) shared(b) + do a = 1, 10 + b(a) = 1 + end do +!$omp end task +!$omp end parallel + end subroutine foo + subroutine bar (b) + integer :: b(10) +!$omp parallel if (.false.) +!$omp parallel if (.false.) + do a = 1, 10 + b(a) = 1 + end do +!$omp end parallel +!$omp end parallel + end subroutine bar +end subroutine pr43337 diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c index fb95088b648..a3aa6c4c384 100644 --- a/gcc/tree-nested.c +++ b/gcc/tree-nested.c @@ -1,5 +1,5 @@ /* Nested function decomposition for GIMPLE. - Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 + Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -1088,7 +1088,8 @@ convert_nonlocal_omp_clauses (tree *pclauses, struct walk_stmt_info *wi) { bitmap_set_bit (new_suppress, DECL_UID (decl)); OMP_CLAUSE_DECL (clause) = get_nonlocal_debug_decl (info, decl); - need_chain = true; + if (OMP_CLAUSE_CODE (clause) != OMP_CLAUSE_PRIVATE) + need_chain = true; } break; -- cgit v1.2.1