aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl2.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-09-03 22:33:21 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2008-09-03 22:33:21 +0200
commit3368cdd3f5f242e4ffe9147802591f5d9b5c40ec (patch)
tree2662e64fc943bf103ce1cf286233d3c13eb6a6c8 /gcc/cp/decl2.c
parent8660d962235b733aacb2c63c6cc11785317d847e (diff)
downloadgcc-3368cdd3f5f242e4ffe9147802591f5d9b5c40ec.zip
gcc-3368cdd3f5f242e4ffe9147802591f5d9b5c40ec.tar.gz
gcc-3368cdd3f5f242e4ffe9147802591f5d9b5c40ec.tar.bz2
re PR c++/37189 (OpenMP task construct with implicit firstprivate variables ICEs)
PR c++/37189 * cp-tree.h (defer_mark_used_calls, deferred_mark_used_calls): New extern decls. * decl2.c (mark_used): If defer_mark_used_calls, push decl into deferred_mark_used_calls vector and exit early. * decl.c (defer_mark_used_calls, deferred_mark_used_calls): New variables. (finish_function): Set defer_mark_used_calls for the duration of the function. Call mark_used on any queued decls. * g++.dg/gomp/pr37189.C: New test. From-SVN: r139955
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r--gcc/cp/decl2.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 4f19766..a128fb7 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -3776,6 +3776,15 @@ mark_used (tree decl)
/* If we don't need a value, then we don't need to synthesize DECL. */
if (skip_evaluation)
return;
+
+ /* If within finish_function, defer the rest until that function
+ finishes, otherwise it might recurse. */
+ if (defer_mark_used_calls)
+ {
+ VEC_safe_push (tree, gc, deferred_mark_used_calls, decl);
+ return;
+ }
+
/* Normally, we can wait until instantiation-time to synthesize
DECL. However, if DECL is a static data member initialized with
a constant, we need the value right now because a reference to