From 2368a460c8d49c4d9aa1aab2b79d6727d19f5b2c Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 20 Jun 2008 04:18:07 +0200 Subject: re PR c++/36523 (OpenMP task construct fails to instantiate copy constructor) PR c++/36523 * cgraphunit.c (cgraph_process_new_functions): Don't clear node->needed and node->reachable. * cgraphbuild.c (record_reference): Handle OMP_PARALLEL and OMP_TASK. * omp-low.c (delete_omp_context): Call finalize_task_copyfn. (expand_task_call): Don't call expand_task_copyfn. (expand_task_copyfn): Renamed to... (finalize_task_copyfn): ... this. * testsuite/libgomp.c++/task-7.C: New function. From-SVN: r136977 --- gcc/cgraphbuild.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'gcc/cgraphbuild.c') diff --git a/gcc/cgraphbuild.c b/gcc/cgraphbuild.c index e37ca86..19e1983 100644 --- a/gcc/cgraphbuild.c +++ b/gcc/cgraphbuild.c @@ -62,6 +62,24 @@ record_reference (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED) } break; + case OMP_PARALLEL: + if (flag_unit_at_a_time) + { + if (OMP_PARALLEL_FN (*tp)) + cgraph_mark_needed_node (cgraph_node (OMP_PARALLEL_FN (*tp))); + } + break; + + case OMP_TASK: + if (flag_unit_at_a_time) + { + if (OMP_TASK_FN (*tp)) + cgraph_mark_needed_node (cgraph_node (OMP_TASK_FN (*tp))); + if (OMP_TASK_COPYFN (*tp)) + cgraph_mark_needed_node (cgraph_node (OMP_TASK_COPYFN (*tp))); + } + break; + default: /* Save some cycles by not walking types and declaration as we won't find anything useful there anyway. */ -- cgit v1.1