diff options
author | Jakub Jelinek <jakub@redhat.com> | 2006-05-02 12:44:55 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2006-05-02 12:44:55 +0200 |
commit | 077b0dfbfe62790f11c2d173da10b80ed752f9d1 (patch) | |
tree | e7fe929b16a97446edb70447a1000494b145b0dd /gcc/cp | |
parent | 2aee3e57aed77de4f5ef28a8711b315aeb1bf77c (diff) | |
download | gcc-077b0dfbfe62790f11c2d173da10b80ed752f9d1.zip gcc-077b0dfbfe62790f11c2d173da10b80ed752f9d1.tar.gz gcc-077b0dfbfe62790f11c2d173da10b80ed752f9d1.tar.bz2 |
re PR middle-end/27337 (OpenMP ICE in expand_expr_real_1 at expr.c:6814)
PR middle-end/27337
* gimplify.c (gimplify_scan_omp_clauses): Handle INDIRECT_REF
around RESULT_DECL for result passed by reference.
(gimplify_expr): Call omp_notice_variable when RESULT_DECL is seen.
* omp-low.c (use_pointer_for_field): Don't look at
DECL_HAS_VALUE_EXPR_P for RESULT_DECLs.
(scan_omp_1): Call remap_decl on RESULT_DECLs.
(lower_rec_input_clauses): Don't allocate VLA memory for the second
time or var for passing by reference for
OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE clauses. Allow creation of
TREE_ADDRESSABLE variables when passing by reference.
* omp-low.c (dump_omp_region): Fix output formatting.
cp/
* cp-gimplify.c (cxx_omp_privatize_by_reference): New function.
* cp-tree.h (cxx_omp_privatize_by_reference): New prototype.
* cp-objcp-common.h (LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE): Define.
testsuite/
* g++.dg/gomp/pr27337-1.C: New test.
* g++.dg/gomp/pr27337-2.C: New test.
libgomp/
* testsuite/libgomp.c++/pr27337.C: New test.
From-SVN: r113456
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/cp-gimplify.c | 11 | ||||
-rw-r--r-- | gcc/cp/cp-objcp-common.h | 2 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 1 |
4 files changed, 20 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index bdc1f41..937d5e8 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2006-05-02 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/27337 + * cp-gimplify.c (cxx_omp_privatize_by_reference): New function. + * cp-tree.h (cxx_omp_privatize_by_reference): New prototype. + * cp-objcp-common.h (LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE): Define. + 2006-04-30 Mark Mitchell <mark@codesourcery.com> PR c++/27094 diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c index be85ebb..4746103 100644 --- a/gcc/cp/cp-gimplify.c +++ b/gcc/cp/cp-gimplify.c @@ -1,6 +1,6 @@ /* C++-specific tree lowering bits; see also c-gimplify.c and tree-gimple.c. - Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Jason Merrill <jason@redhat.com> This file is part of GCC. @@ -870,3 +870,12 @@ cxx_omp_clause_dtor (tree clause, tree decl) return ret; } + +/* True if OpenMP should privatize what this DECL points to rather + than the DECL itself. */ + +bool +cxx_omp_privatize_by_reference (tree decl) +{ + return TREE_CODE (decl) == RESULT_DECL && DECL_BY_REFERENCE (decl); +} diff --git a/gcc/cp/cp-objcp-common.h b/gcc/cp/cp-objcp-common.h index 96e6eb6..65eb6ae 100644 --- a/gcc/cp/cp-objcp-common.h +++ b/gcc/cp/cp-objcp-common.h @@ -161,5 +161,7 @@ extern tree objcp_tsubst_copy_and_build (tree, tree, tsubst_flags_t, #define LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP cxx_omp_clause_assign_op #undef LANG_HOOKS_OMP_CLAUSE_DTOR #define LANG_HOOKS_OMP_CLAUSE_DTOR cxx_omp_clause_dtor +#undef LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE +#define LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE cxx_omp_privatize_by_reference #endif /* GCC_CP_OBJCP_COMMON */ diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 1e3c1b7..2e5739a 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -4267,6 +4267,7 @@ extern tree cxx_omp_clause_default_ctor (tree, tree); extern tree cxx_omp_clause_copy_ctor (tree, tree, tree); extern tree cxx_omp_clause_assign_op (tree, tree, tree); extern tree cxx_omp_clause_dtor (tree, tree); +extern bool cxx_omp_privatize_by_reference (tree); /* in tree.c */ extern void lang_check_failed (const char *, int, |