summaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2020-05-26 09:35:21 +0200
committerGiuliano Belinassi <giuliano.belinassi@usp.br>2020-08-17 13:09:01 -0300
commitc7dee387e695b7d99dfd8c013c46e2c72b5c6811 (patch)
treefd9762d60c5dcc7358361b254ad81501f804a20e /gcc/gimplify.c
parent111beaed391516337ce0283d5955998b542f9546 (diff)
downloadgcc-c7dee387e695b7d99dfd8c013c46e2c72b5c6811.tar.gz
openmp: Ensure copy ctor for composite distribute parallel for class iterators is instantiated [PR95197]
During gimplification omp_finish_clause langhook is called in several places to add the language specific info to the clause like what default/copy ctors, dtors and assignment operators should be used. Unfortunately, if it refers to some not yet instantiated method, during gimplification it is too late and the methods will not be instantiated anymore. For other cases, the genericizer has code to detect those and instantiate whatever is needed, this change adds the same for distribute parallel for class iterators where we under the hood need a copy constructor for the iterator to implement it. 2020-05-26 Jakub Jelinek <jakub@redhat.com> PR c++/95197 * gimplify.c (find_combined_omp_for): Move to omp-general.c. * omp-general.h (find_combined_omp_for): Declare. * omp-general.c: Include tree-iterator.h. (find_combined_omp_for): New function, moved from gimplify.c. * cp-gimplify.c: Include omp-general.h. (cp_genericize_r) <case OMP_DISTRIBUTE>: For class iteration variables in composite distribute parallel for, instantiate copy ctor of their types.
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c56
1 files changed, 0 insertions, 56 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index e104e766517..7f00d97baa1 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -10963,62 +10963,6 @@ gimplify_omp_task (tree *expr_p, gimple_seq *pre_p)
*expr_p = NULL_TREE;
}
-/* Helper function of gimplify_omp_for, find OMP_FOR resp. OMP_SIMD
- with non-NULL OMP_FOR_INIT. Also, fill in pdata array,
- pdata[0] non-NULL if there is anything non-trivial in between, pdata[1]
- is address of OMP_PARALLEL in between if any, pdata[2] is address of
- OMP_FOR in between if any and pdata[3] is address of the inner
- OMP_FOR/OMP_SIMD. */
-
-static tree
-find_combined_omp_for (tree *tp, int *walk_subtrees, void *data)
-{
- tree **pdata = (tree **) data;
- *walk_subtrees = 0;
- switch (TREE_CODE (*tp))
- {
- case OMP_FOR:
- if (OMP_FOR_INIT (*tp) != NULL_TREE)
- {
- pdata[3] = tp;
- return *tp;
- }
- pdata[2] = tp;
- *walk_subtrees = 1;
- break;
- case OMP_SIMD:
- if (OMP_FOR_INIT (*tp) != NULL_TREE)
- {
- pdata[3] = tp;
- return *tp;
- }
- break;
- case BIND_EXPR:
- if (BIND_EXPR_VARS (*tp)
- || (BIND_EXPR_BLOCK (*tp)
- && BLOCK_VARS (BIND_EXPR_BLOCK (*tp))))
- pdata[0] = tp;
- *walk_subtrees = 1;
- break;
- case STATEMENT_LIST:
- if (!tsi_one_before_end_p (tsi_start (*tp)))
- pdata[0] = tp;
- *walk_subtrees = 1;
- break;
- case TRY_FINALLY_EXPR:
- pdata[0] = tp;
- *walk_subtrees = 1;
- break;
- case OMP_PARALLEL:
- pdata[1] = tp;
- *walk_subtrees = 1;
- break;
- default:
- break;
- }
- return NULL_TREE;
-}
-
/* Gimplify the gross structure of an OMP_FOR statement. */
static enum gimplify_status